Compare commits
108
Commits
195d4169f5
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cca2b20c3d | ||
|
|
105c454d73 | ||
|
|
cf6feefebc | ||
|
|
1857c8f771 | ||
|
|
542ad4ab9c | ||
|
|
9bf8599116 | ||
|
|
170c9a53f1 | ||
|
|
e0d5095099 | ||
|
|
08a8a10478 | ||
|
|
7bbaf14d14 | ||
|
|
b7d0b01122 | ||
|
|
4627266577 | ||
|
|
471ec4b12a | ||
|
|
060a61fd41 | ||
|
|
7cef95225a | ||
|
|
0ae62226bc | ||
|
|
610ab6fdf5 | ||
|
|
81275c0395 | ||
|
|
4a46651839 | ||
|
|
e7f06548fb | ||
|
|
e2a703fc72 | ||
|
|
de75d8374d | ||
|
|
b807fbe69a | ||
|
|
827cd9bcbc | ||
|
|
fa2b607979 | ||
|
|
4fe690e1e2 | ||
|
|
3553daa086 | ||
|
|
a4c5bcfbdf | ||
|
|
026c2696b6 | ||
|
|
6cb4168f44 | ||
|
|
b82ef82f50 | ||
|
|
9a18434f4a | ||
|
|
f126eacf8c | ||
|
|
848b12ce5d | ||
|
|
3d350bd9e5 | ||
|
|
e03dd8c5a6 | ||
|
|
9101a5b48e | ||
|
|
1186f4f620 | ||
|
|
988fcaf855 | ||
|
|
b27031f7c4 | ||
|
|
7ee60e7313 | ||
|
|
671090b1b1 | ||
|
|
0f03bb7446 | ||
|
|
55a1e5bf8f | ||
|
|
33ae035adc | ||
|
|
87d575f335 | ||
|
|
e4329f76b1 | ||
|
|
fa4cf20022 | ||
|
|
2ecfc2e12d | ||
|
|
db2ac80a1e | ||
|
|
99490bfc4d | ||
|
|
fce17654f8 | ||
|
|
419207ac12 | ||
|
|
e30ac71044 | ||
|
|
781e348ded | ||
|
|
e16a18e488 | ||
|
|
7cd3cbaae5 | ||
|
|
60f07fddc9 | ||
|
|
068415849f | ||
|
|
e39e2a361a | ||
|
|
9d3e749c38 | ||
|
|
b7c6cb4d81 | ||
|
|
c41b75e364 | ||
|
|
41630bb8c5 | ||
|
|
b9430e7ab6 | ||
|
|
f1f808d079 | ||
|
|
a8a632e1b0 | ||
|
|
a695ec7319 | ||
|
|
c6730335ef | ||
|
|
247b849759 | ||
|
|
0dee178ded | ||
|
|
9359f26788 | ||
|
|
5630765215 | ||
|
|
ed4a78b109 | ||
|
|
9acb22e2f9 | ||
|
|
6a8361d710 | ||
|
|
502ffee31f | ||
|
|
5a322230ae | ||
|
|
f919c288b2 | ||
|
|
21b948a4f8 | ||
|
|
d04271f942 | ||
|
|
4f08e9ea4d | ||
|
|
67347f1e34 | ||
|
|
75f2b6400d | ||
|
|
26aec1c5af | ||
|
|
0fe7ca0575 | ||
|
|
d745a764fe | ||
|
|
6c273118a2 | ||
|
|
a010a7368a | ||
|
|
08bd00f01f | ||
|
|
cef7f46718 | ||
|
|
ac48f1e9d1 | ||
|
|
3d8bc9019f | ||
|
|
cd65c2799f | ||
|
|
282be290cd | ||
|
|
080f41c7d8 | ||
|
|
37e417e057 | ||
|
|
05b3dc8cb1 | ||
|
|
81fa409513 | ||
|
|
90068c7952 | ||
|
|
2215766940 | ||
|
|
5aa66ff37a | ||
|
|
eb043bba4a | ||
|
|
68560534ac | ||
|
|
657f50a135 | ||
|
|
720bf6914b | ||
|
|
5f76050fa8 | ||
|
|
4bf50514bf |
Vendored
-11
@@ -1,11 +0,0 @@
|
|||||||
export { Analytics } from '../modules/analytics/client.js';
|
|
||||||
/**
|
|
||||||
* Entry point: ipal-kit/client
|
|
||||||
*
|
|
||||||
* Client-side ('use client') exports — React hooks, providers, and UI
|
|
||||||
* components. Kept separate from the main entry so server bundles don't pull in
|
|
||||||
* client-only code.
|
|
||||||
*/ export { ConsentProvider, CookieBanner, CookieButton, useConsent, useConsentContext } from '../modules/consent/client.js';
|
|
||||||
export { Turnstile } from '../modules/turnstile/client.js';
|
|
||||||
|
|
||||||
//# sourceMappingURL=client.d.js.map
|
|
||||||
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["client.d.ts"],"sourcesContent":["export { 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 { ConsentProvider, CookieBanner, CookieButton, useConsent, useConsentContext, } from '../modules/consent/client.js';\nexport type { CookieBannerClassNames } from '../modules/consent/client.js';\nexport { Turnstile } from '../modules/turnstile/client.js';\nexport type { TurnstileProps } from '../modules/turnstile/client.js';\n"],"names":["Analytics","ConsentProvider","CookieBanner","CookieButton","useConsent","useConsentContext","Turnstile"],"mappings":"AAAA,SAASA,SAAS,QAAQ,iCAAiC;AAC3D;;;;;;CAMC,GACD,SAASC,eAAe,EAAEC,YAAY,EAAEC,YAAY,EAAEC,UAAU,EAAEC,iBAAiB,QAAS,+BAA+B;AAE3H,SAASC,SAAS,QAAQ,iCAAiC"}
|
|
||||||
Vendored
+7
@@ -1,3 +1,7 @@
|
|||||||
|
export { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js';
|
||||||
|
export { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js';
|
||||||
|
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 { Analytics } from '../modules/analytics/client.js';
|
||||||
/**
|
/**
|
||||||
* Entry point: ipal-kit/client
|
* Entry point: ipal-kit/client
|
||||||
@@ -8,5 +12,8 @@ export { Analytics } from '../modules/analytics/client.js';
|
|||||||
*/
|
*/
|
||||||
export { ConsentProvider, CookieBanner, CookieButton, useConsent, useConsentContext, } from '../modules/consent/client.js';
|
export { ConsentProvider, CookieBanner, CookieButton, useConsent, useConsentContext, } from '../modules/consent/client.js';
|
||||||
export type { CookieBannerClassNames } from '../modules/consent/client.js';
|
export type { CookieBannerClassNames } from '../modules/consent/client.js';
|
||||||
|
export { buildLocalizedPath, getLocaleCodes, getLocalizedSlugs, switchLocalePath, } from '../modules/i18n/index.js';
|
||||||
|
export type { I18nConfig, LocalizedSlugs } from '../modules/i18n/index.js';
|
||||||
export { Turnstile } from '../modules/turnstile/client.js';
|
export { Turnstile } from '../modules/turnstile/client.js';
|
||||||
|
export { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js';
|
||||||
export type { TurnstileProps } from '../modules/turnstile/client.js';
|
export type { TurnstileProps } from '../modules/turnstile/client.js';
|
||||||
|
|||||||
Vendored
+7
@@ -1,4 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
export { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js';
|
||||||
|
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 { Analytics } from '../modules/analytics/client.js';
|
||||||
/**
|
/**
|
||||||
* Entry point: ipal-kit/client
|
* Entry point: ipal-kit/client
|
||||||
@@ -7,6 +10,10 @@ export { Analytics } from '../modules/analytics/client.js';
|
|||||||
* components. Kept separate from the main entry so server bundles don't pull in
|
* components. Kept separate from the main entry so server bundles don't pull in
|
||||||
* client-only code.
|
* client-only code.
|
||||||
*/ export { ConsentProvider, CookieBanner, CookieButton, useConsent, useConsentContext } from '../modules/consent/client.js';
|
*/ export { ConsentProvider, CookieBanner, CookieButton, useConsent, useConsentContext } from '../modules/consent/client.js';
|
||||||
|
// Pure i18n path helpers — no server/RSC deps, safe to import in client
|
||||||
|
// components (e.g. a LanguageSwitcher that computes locale URLs on the client).
|
||||||
|
export { buildLocalizedPath, getLocaleCodes, getLocalizedSlugs, switchLocalePath } from '../modules/i18n/index.js';
|
||||||
export { Turnstile } from '../modules/turnstile/client.js';
|
export { Turnstile } from '../modules/turnstile/client.js';
|
||||||
|
export { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js';
|
||||||
|
|
||||||
//# sourceMappingURL=client.js.map
|
//# sourceMappingURL=client.js.map
|
||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["'use client'\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 CookieBanner,\n CookieButton,\n useConsent,\n useConsentContext,\n} from '../modules/consent/client.js'\nexport type { CookieBannerClassNames } from '../modules/consent/client.js'\nexport { Turnstile } from '../modules/turnstile/client.js'\nexport type { TurnstileProps } from '../modules/turnstile/client.js'\n"],"names":["Analytics","ConsentProvider","CookieBanner","CookieButton","useConsent","useConsentContext","Turnstile"],"mappings":"AAAA;AACA,SAASA,SAAS,QAAQ,iCAAgC;AAC1D;;;;;;CAMC,GACD,SACEC,eAAe,EACfC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,iBAAiB,QACZ,+BAA8B;AAErC,SAASC,SAAS,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'\n\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 CookieBanner,\n CookieButton,\n useConsent,\n useConsentContext,\n} from '../modules/consent/client.js'\nexport type { CookieBannerClassNames } from '../modules/consent/client.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 { 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","CookieBanner","CookieButton","useConsent","useConsentContext","buildLocalizedPath","getLocaleCodes","getLocalizedSlugs","switchLocalePath","Turnstile","TurnstileProvider","useTurnstile"],"mappings":"AAAA;AACA,SAASA,WAAW,QAAQ,wDAAuD;AACnF,SAASC,eAAe,QAAQ,4DAA2D;AAC3F,SACEC,qBAAqB,EACrBC,mBAAmB,EACnBC,gBAAgB,QACX,qCAAoC;AAG3C,SAASC,SAAS,QAAQ,iCAAgC;AAC1D;;;;;;CAMC,GACD,SACEC,eAAe,EACfC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,iBAAiB,QACZ,+BAA8B;AAErC,wEAAwE;AACxE,gFAAgF;AAChF,SACEC,kBAAkB,EAClBC,cAAc,EACdC,iBAAiB,EACjBC,gBAAgB,QACX,2BAA0B;AAEjC,SAASC,SAAS,QAAQ,iCAAgC;AAC1D,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,iCAAgC"}
|
||||||
Vendored
-9
@@ -1,9 +0,0 @@
|
|||||||
/**
|
|
||||||
* Entry point: ipal-kit/next/middleware
|
|
||||||
*
|
|
||||||
* Re-exports the locale middleware factory and default matcher for use in a
|
|
||||||
* client project's middleware.ts. Kept as a thin re-export so the Next-facing
|
|
||||||
* surface is separate from the main package export.
|
|
||||||
*/ export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from '../modules/i18n/index.js';
|
|
||||||
|
|
||||||
//# sourceMappingURL=next-middleware.d.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["next-middleware.d.ts"],"sourcesContent":["/**\n * Entry point: ipal-kit/next/middleware\n *\n * Re-exports the locale middleware factory and default matcher for use in a\n * client project's middleware.ts. Kept as a thin re-export so the Next-facing\n * surface is separate from the main package export.\n */\nexport { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from '../modules/i18n/index.js';\nexport type { LocaleMiddlewareResult } from '../modules/i18n/index.js';\n"],"names":["createLocaleMiddleware","DEFAULT_MIDDLEWARE_MATCHER"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,sBAAsB,EAAEC,0BAA0B,QAAQ,2BAA2B"}
|
|
||||||
Vendored
-9
@@ -1,9 +0,0 @@
|
|||||||
/**
|
|
||||||
* Entry point: ipal-kit/rsc
|
|
||||||
*
|
|
||||||
* Server-component exports. RenderBlocks is a React Server Component, so it
|
|
||||||
* lives here rather than in the main package entry to keep React out of the
|
|
||||||
* server-config bundle.
|
|
||||||
*/ export { RenderBlocks } from '../modules/blocks/index.js';
|
|
||||||
|
|
||||||
//# sourceMappingURL=rsc.d.js.map
|
|
||||||
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["rsc.d.ts"],"sourcesContent":["/**\n * Entry point: ipal-kit/rsc\n *\n * Server-component exports. RenderBlocks is a React Server Component, so it\n * lives here rather than in the main package entry to keep React out of the\n * server-config bundle.\n */\nexport { RenderBlocks } from '../modules/blocks/index.js';\nexport type { BlockComponentMap, BlockData, EnhanceProps, RenderBlocksProps, } from '../modules/blocks/index.js';\n"],"names":["RenderBlocks"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,YAAY,QAAQ,6BAA6B"}
|
|
||||||
Vendored
+1
@@ -7,3 +7,4 @@
|
|||||||
*/
|
*/
|
||||||
export { RenderBlocks } from '../modules/blocks/index.js';
|
export { RenderBlocks } from '../modules/blocks/index.js';
|
||||||
export type { BlockComponentMap, BlockData, EnhanceProps, RenderBlocksProps, } from '../modules/blocks/index.js';
|
export type { BlockComponentMap, BlockData, EnhanceProps, RenderBlocksProps, } from '../modules/blocks/index.js';
|
||||||
|
export { MediaPreconnect } from '../modules/storage/MediaPreconnect.js';
|
||||||
|
|||||||
Vendored
+1
@@ -5,5 +5,6 @@
|
|||||||
* lives here rather than in the main package entry to keep React out of the
|
* lives here rather than in the main package entry to keep React out of the
|
||||||
* server-config bundle.
|
* server-config bundle.
|
||||||
*/ export { RenderBlocks } from '../modules/blocks/index.js';
|
*/ export { RenderBlocks } from '../modules/blocks/index.js';
|
||||||
|
export { MediaPreconnect } from '../modules/storage/MediaPreconnect.js';
|
||||||
|
|
||||||
//# sourceMappingURL=rsc.js.map
|
//# sourceMappingURL=rsc.js.map
|
||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../src/exports/rsc.ts"],"sourcesContent":["/**\n * Entry point: ipal-kit/rsc\n *\n * Server-component exports. RenderBlocks is a React Server Component, so it\n * lives here rather than in the main package entry to keep React out of the\n * server-config bundle.\n */\nexport { RenderBlocks } from '../modules/blocks/index.js'\nexport type {\n BlockComponentMap,\n BlockData,\n EnhanceProps,\n RenderBlocksProps,\n} from '../modules/blocks/index.js'\n"],"names":["RenderBlocks"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,YAAY,QAAQ,6BAA4B"}
|
{"version":3,"sources":["../../src/exports/rsc.ts"],"sourcesContent":["/**\n * Entry point: ipal-kit/rsc\n *\n * Server-component exports. RenderBlocks is a React Server Component, so it\n * lives here rather than in the main package entry to keep React out of the\n * server-config bundle.\n */\nexport { RenderBlocks } from '../modules/blocks/index.js'\nexport type {\n BlockComponentMap,\n BlockData,\n EnhanceProps,\n RenderBlocksProps,\n} from '../modules/blocks/index.js'\nexport { MediaPreconnect } from '../modules/storage/MediaPreconnect.js'\n"],"names":["RenderBlocks","MediaPreconnect"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,YAAY,QAAQ,6BAA4B;AAOzD,SAASC,eAAe,QAAQ,wCAAuC"}
|
||||||
Vendored
-16
@@ -1,16 +0,0 @@
|
|||||||
/**
|
|
||||||
* Entry point: ipal-kit/server
|
|
||||||
*
|
|
||||||
* Server-only runtime functions — these import 'server-only' (Turnstile secret,
|
|
||||||
* SMTP password, nodemailer). Kept OUT of the main entry so that loading the
|
|
||||||
* Payload config or running `payload generate:importmap` (both Node scripts,
|
|
||||||
* no bundler) never pulls in 'server-only', which throws outside a bundled
|
|
||||||
* server context.
|
|
||||||
*
|
|
||||||
* Import these only from Server Actions, route handlers, or server components —
|
|
||||||
* never from the Payload config or client code.
|
|
||||||
*/ export { verifyTurnstile } from '../modules/turnstile/index.js';
|
|
||||||
export { sendEmail } from '../modules/email/index.js';
|
|
||||||
export { submitForm } from '../modules/forms/index.js';
|
|
||||||
|
|
||||||
//# sourceMappingURL=server.d.js.map
|
|
||||||
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["server.d.ts"],"sourcesContent":["/**\n * Entry point: ipal-kit/server\n *\n * Server-only runtime functions — these import 'server-only' (Turnstile secret,\n * SMTP password, nodemailer). Kept OUT of the main entry so that loading the\n * Payload config or running `payload generate:importmap` (both Node scripts,\n * no bundler) never pulls in 'server-only', which throws outside a bundled\n * server context.\n *\n * Import these only from Server Actions, route handlers, or server components —\n * never from the Payload config or client code.\n */\nexport { verifyTurnstile } from '../modules/turnstile/index.js';\nexport { sendEmail } from '../modules/email/index.js';\nexport type { SendEmailArgs, SendEmailResult } from '../modules/email/index.js';\nexport { submitForm } from '../modules/forms/index.js';\nexport type { SubmitFormArgs, SubmitFormResult } from '../modules/forms/index.js';\n"],"names":["verifyTurnstile","sendEmail","submitForm"],"mappings":"AAAA;;;;;;;;;;;CAWC,GACD,SAASA,eAAe,QAAQ,gCAAgC;AAChE,SAASC,SAAS,QAAQ,4BAA4B;AAEtD,SAASC,UAAU,QAAQ,4BAA4B"}
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
/**
|
|
||||||
* Fields for the CookieSettings global — GDPR consent banner copy, editable
|
|
||||||
* per locale. The privacy-policy link is NOT stored here: it comes from the
|
|
||||||
* pages module (system page role 'privacyPolicy'), keeping one source of truth.
|
|
||||||
*/ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=fields.d.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["fields.d.ts"],"sourcesContent":["import type { Field } from 'payload';\n/**\n * Fields for the CookieSettings global — GDPR consent banner copy, editable\n * per locale. The privacy-policy link is NOT stored here: it comes from the\n * pages module (system page role 'privacyPolicy'), keeping one source of truth.\n */\nexport declare const cookieSettingsFields: Field[];\n"],"names":[],"mappings":"AACA;;;;CAIC,GACD,WAAmD"}
|
|
||||||
-6
@@ -1,6 +0,0 @@
|
|||||||
/**
|
|
||||||
* Builds the CookieSettings global — consent banner copy managed by editors.
|
|
||||||
* Public read (the banner needs it on the frontend for anonymous visitors).
|
|
||||||
*/ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=index.d.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["index.d.ts"],"sourcesContent":["import type { GlobalConfig } from 'payload';\n/**\n * Builds the CookieSettings global — consent banner copy managed by editors.\n * Public read (the banner needs it on the frontend for anonymous visitors).\n */\nexport declare function buildCookieSettings(): GlobalConfig;\n"],"names":[],"mappings":"AACA;;;CAGC,GACD,WAA4D"}
|
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
import type { Field } from 'payload';
|
||||||
|
/**
|
||||||
|
* Fields for the Notifications global — localized user-facing texts for action
|
||||||
|
* results (form submission outcomes, and future contexts). Every text is
|
||||||
|
* localized: true so each language has its own value. Empty fields fall back to
|
||||||
|
* built-in English defaults (see modules/notifications/defaults).
|
||||||
|
*
|
||||||
|
* Grouped per context. `form` holds the outcomes of submitForm; more groups
|
||||||
|
* (e.g. `newsletter`, `system`) can be added the same way without touching
|
||||||
|
* consumers — getNotificationTexts resolves whatever exists, falling back
|
||||||
|
* per field.
|
||||||
|
*/
|
||||||
|
export declare const notificationsFields: Field[];
|
||||||
Vendored
+82
@@ -0,0 +1,82 @@
|
|||||||
|
/**
|
||||||
|
* Fields for the Notifications global — localized user-facing texts for action
|
||||||
|
* results (form submission outcomes, and future contexts). Every text is
|
||||||
|
* localized: true so each language has its own value. Empty fields fall back to
|
||||||
|
* built-in English defaults (see modules/notifications/defaults).
|
||||||
|
*
|
||||||
|
* Grouped per context. `form` holds the outcomes of submitForm; more groups
|
||||||
|
* (e.g. `newsletter`, `system`) can be added the same way without touching
|
||||||
|
* consumers — getNotificationTexts resolves whatever exists, falling back
|
||||||
|
* per field.
|
||||||
|
*/ export const notificationsFields = [
|
||||||
|
{
|
||||||
|
name: 'form',
|
||||||
|
type: 'group',
|
||||||
|
admin: {
|
||||||
|
description: 'Messages shown after a form is submitted. Leave a field empty to use the built-in default.'
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'success',
|
||||||
|
type: 'text',
|
||||||
|
admin: {
|
||||||
|
placeholder: 'Thank you — your message has been sent.'
|
||||||
|
},
|
||||||
|
localized: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'error',
|
||||||
|
type: 'text',
|
||||||
|
admin: {
|
||||||
|
placeholder: 'Something went wrong. Please try again later.'
|
||||||
|
},
|
||||||
|
localized: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'rateLimited',
|
||||||
|
type: 'text',
|
||||||
|
admin: {
|
||||||
|
placeholder: 'Too many attempts. Please wait a moment and try again.'
|
||||||
|
},
|
||||||
|
localized: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'turnstile',
|
||||||
|
type: 'text',
|
||||||
|
admin: {
|
||||||
|
placeholder: 'Captcha verification failed. Please try again.'
|
||||||
|
},
|
||||||
|
localized: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'validation',
|
||||||
|
type: 'text',
|
||||||
|
admin: {
|
||||||
|
description: 'Shown on a validation error. Use {field} to insert the offending field name.',
|
||||||
|
placeholder: 'Please check the {field} field and try again.'
|
||||||
|
},
|
||||||
|
localized: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'consent',
|
||||||
|
type: 'text',
|
||||||
|
admin: {
|
||||||
|
description: 'Shown when the GDPR consent checkbox is left unchecked.',
|
||||||
|
placeholder: 'Please accept the privacy policy to continue.'
|
||||||
|
},
|
||||||
|
localized: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'notFound',
|
||||||
|
type: 'text',
|
||||||
|
admin: {
|
||||||
|
placeholder: 'This form is no longer available.'
|
||||||
|
},
|
||||||
|
localized: true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
label: 'Form messages'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
//# sourceMappingURL=fields.js.map
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"sources":["../../../src/globals/Notifications/fields.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Fields for the Notifications global — localized user-facing texts for action\n * results (form submission outcomes, and future contexts). Every text is\n * localized: true so each language has its own value. Empty fields fall back to\n * built-in English defaults (see modules/notifications/defaults).\n *\n * Grouped per context. `form` holds the outcomes of submitForm; more groups\n * (e.g. `newsletter`, `system`) can be added the same way without touching\n * consumers — getNotificationTexts resolves whatever exists, falling back\n * per field.\n */\nexport const notificationsFields: Field[] = [\n {\n name: 'form',\n type: 'group',\n admin: {\n description:\n 'Messages shown after a form is submitted. Leave a field empty to use the built-in default.',\n },\n fields: [\n {\n name: 'success',\n type: 'text',\n admin: { placeholder: 'Thank you — your message has been sent.' },\n localized: true,\n },\n {\n name: 'error',\n type: 'text',\n admin: { placeholder: 'Something went wrong. Please try again later.' },\n localized: true,\n },\n {\n name: 'rateLimited',\n type: 'text',\n admin: { placeholder: 'Too many attempts. Please wait a moment and try again.' },\n localized: true,\n },\n {\n name: 'turnstile',\n type: 'text',\n admin: { placeholder: 'Captcha verification failed. Please try again.' },\n localized: true,\n },\n {\n name: 'validation',\n type: 'text',\n admin: {\n description:\n 'Shown on a validation error. Use {field} to insert the offending field name.',\n placeholder: 'Please check the {field} field and try again.',\n },\n localized: true,\n },\n {\n name: 'consent',\n type: 'text',\n admin: {\n description: 'Shown when the GDPR consent checkbox is left unchecked.',\n placeholder: 'Please accept the privacy policy to continue.',\n },\n localized: true,\n },\n {\n name: 'notFound',\n type: 'text',\n admin: { placeholder: 'This form is no longer available.' },\n localized: true,\n },\n ],\n label: 'Form messages',\n },\n]\n"],"names":["notificationsFields","name","type","admin","description","fields","placeholder","localized","label"],"mappings":"AAEA;;;;;;;;;;CAUC,GACD,OAAO,MAAMA,sBAA+B;IAC1C;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QACJ;QACAC,QAAQ;YACN;gBACEJ,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAA0C;gBAChEC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAAgD;gBACtEC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAAyD;gBAC/EC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAAiD;gBACvEC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBACLC,aACE;oBACFE,aAAa;gBACf;gBACAC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBACLC,aAAa;oBACbE,aAAa;gBACf;gBACAC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAAoC;gBAC1DC,WAAW;YACb;SACD;QACDC,OAAO;IACT;CACD,CAAA"}
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
import type { GlobalConfig } from 'payload';
|
||||||
|
/**
|
||||||
|
* Builds the Notifications global — localized action-result texts. Readable by
|
||||||
|
* any authenticated panel user; server-side helpers read it with overrideAccess
|
||||||
|
* so the frontend can resolve texts without a session.
|
||||||
|
*/
|
||||||
|
export declare function buildNotifications(): GlobalConfig;
|
||||||
Vendored
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import { notificationsFields } from './fields.js';
|
||||||
|
/**
|
||||||
|
* Builds the Notifications global — localized action-result texts. Readable by
|
||||||
|
* any authenticated panel user; server-side helpers read it with overrideAccess
|
||||||
|
* so the frontend can resolve texts without a session.
|
||||||
|
*/ export function buildNotifications() {
|
||||||
|
return {
|
||||||
|
slug: 'notifications',
|
||||||
|
access: {
|
||||||
|
read: ()=>true
|
||||||
|
},
|
||||||
|
fields: notificationsFields,
|
||||||
|
label: 'Notifications'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
//# sourceMappingURL=index.js.map
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"sources":["../../../src/globals/Notifications/index.ts"],"sourcesContent":["import type { GlobalConfig } from 'payload'\n\nimport { notificationsFields } from './fields.js'\n\n/**\n * Builds the Notifications global — localized action-result texts. Readable by\n * any authenticated panel user; server-side helpers read it with overrideAccess\n * so the frontend can resolve texts without a session.\n */\nexport function buildNotifications(): GlobalConfig {\n return {\n slug: 'notifications',\n access: {\n read: () => true, // texts are public-facing (shown to end users)\n },\n fields: notificationsFields,\n label: 'Notifications',\n }\n}\n"],"names":["notificationsFields","buildNotifications","slug","access","read","fields","label"],"mappings":"AAEA,SAASA,mBAAmB,QAAQ,cAAa;AAEjD;;;;CAIC,GACD,OAAO,SAASC;IACd,OAAO;QACLC,MAAM;QACNC,QAAQ;YACNC,MAAM,IAAM;QACd;QACAC,QAAQL;QACRM,OAAO;IACT;AACF"}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import type { TextFieldClientComponent } from 'payload';
|
||||||
|
export declare const MaskedField: TextFieldClientComponent;
|
||||||
|
export default MaskedField;
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
'use client';
|
||||||
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||||
|
import { useState } from 'react';
|
||||||
|
export const MaskedField = (props)=>{
|
||||||
|
const { field, path, value: propValue, setValue: propSetValue, onChange: propOnChange } = props || {};
|
||||||
|
const [internalValue, setInternalValue] = useState(propValue ?? '');
|
||||||
|
const [revealed, setRevealed] = useState(false);
|
||||||
|
const label = typeof field?.label === 'string' ? field.label : field?.name ?? path;
|
||||||
|
const handleChange = (e)=>{
|
||||||
|
const newVal = e.target.value;
|
||||||
|
setInternalValue(newVal);
|
||||||
|
if (typeof propSetValue === 'function') {
|
||||||
|
propSetValue(newVal);
|
||||||
|
}
|
||||||
|
if (typeof propOnChange === 'function') {
|
||||||
|
propOnChange(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const currentValue = propValue !== undefined ? propValue : internalValue;
|
||||||
|
return /*#__PURE__*/ _jsxs("div", {
|
||||||
|
className: "field-type text",
|
||||||
|
children: [
|
||||||
|
label && /*#__PURE__*/ _jsx("label", {
|
||||||
|
className: "field-label",
|
||||||
|
children: label
|
||||||
|
}),
|
||||||
|
/*#__PURE__*/ _jsxs("div", {
|
||||||
|
style: {
|
||||||
|
display: 'flex',
|
||||||
|
gap: '.5rem'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
/*#__PURE__*/ _jsx("input", {
|
||||||
|
autoComplete: "off",
|
||||||
|
onChange: handleChange,
|
||||||
|
style: {
|
||||||
|
flex: 1
|
||||||
|
},
|
||||||
|
type: revealed ? 'text' : 'password',
|
||||||
|
value: currentValue ?? ''
|
||||||
|
}),
|
||||||
|
/*#__PURE__*/ _jsx("button", {
|
||||||
|
onClick: ()=>setRevealed((r)=>!r),
|
||||||
|
type: "button",
|
||||||
|
children: revealed ? 'Hide' : 'Reveal'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
});
|
||||||
|
};
|
||||||
|
export default MaskedField;
|
||||||
|
|
||||||
|
//# sourceMappingURL=MaskedField.js.map
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/components/MaskedField.tsx"],"sourcesContent":["'use client'\nimport type { TextFieldClientComponent } from 'payload'\nimport { useState } from 'react'\n\nexport const MaskedField: TextFieldClientComponent = (props: any) => {\n const { field, path, value: propValue, setValue: propSetValue, onChange: propOnChange } = props || {}\n const [internalValue, setInternalValue] = useState(propValue ?? '')\n const [revealed, setRevealed] = useState(false)\n const label = typeof field?.label === 'string' ? field.label : (field?.name ?? path)\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newVal = e.target.value\n setInternalValue(newVal)\n if (typeof propSetValue === 'function') {\n propSetValue(newVal)\n }\n if (typeof propOnChange === 'function') {\n propOnChange(e)\n }\n }\n\n const currentValue = propValue !== undefined ? propValue : internalValue\n\n return (\n <div className=\"field-type text\">\n {label && <label className=\"field-label\">{label}</label>}\n <div style={{ display: 'flex', gap: '.5rem' }}>\n <input\n autoComplete=\"off\"\n onChange={handleChange}\n style={{ flex: 1 }}\n type={revealed ? 'text' : 'password'}\n value={currentValue ?? ''}\n />\n <button onClick={() => setRevealed((r) => !r)} type=\"button\">\n {revealed ? 'Hide' : 'Reveal'}\n </button>\n </div>\n </div>\n )\n}\n\nexport default MaskedField\n"],"names":["useState","MaskedField","props","field","path","value","propValue","setValue","propSetValue","onChange","propOnChange","internalValue","setInternalValue","revealed","setRevealed","label","name","handleChange","e","newVal","target","currentValue","undefined","div","className","style","display","gap","input","autoComplete","flex","type","button","onClick","r"],"mappings":"AAAA;;AAEA,SAASA,QAAQ,QAAQ,QAAO;AAEhC,OAAO,MAAMC,cAAwC,CAACC;IACpD,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAEC,OAAOC,SAAS,EAAEC,UAAUC,YAAY,EAAEC,UAAUC,YAAY,EAAE,GAAGR,SAAS,CAAC;IACpG,MAAM,CAACS,eAAeC,iBAAiB,GAAGZ,SAASM,aAAa;IAChE,MAAM,CAACO,UAAUC,YAAY,GAAGd,SAAS;IACzC,MAAMe,QAAQ,OAAOZ,OAAOY,UAAU,WAAWZ,MAAMY,KAAK,GAAIZ,OAAOa,QAAQZ;IAE/E,MAAMa,eAAe,CAACC;QACpB,MAAMC,SAASD,EAAEE,MAAM,CAACf,KAAK;QAC7BO,iBAAiBO;QACjB,IAAI,OAAOX,iBAAiB,YAAY;YACtCA,aAAaW;QACf;QACA,IAAI,OAAOT,iBAAiB,YAAY;YACtCA,aAAaQ;QACf;IACF;IAEA,MAAMG,eAAef,cAAcgB,YAAYhB,YAAYK;IAE3D,qBACE,MAACY;QAAIC,WAAU;;YACZT,uBAAS,KAACA;gBAAMS,WAAU;0BAAeT;;0BAC1C,MAACQ;gBAAIE,OAAO;oBAAEC,SAAS;oBAAQC,KAAK;gBAAQ;;kCAC1C,KAACC;wBACCC,cAAa;wBACbpB,UAAUQ;wBACVQ,OAAO;4BAAEK,MAAM;wBAAE;wBACjBC,MAAMlB,WAAW,SAAS;wBAC1BR,OAAOgB,gBAAgB;;kCAEzB,KAACW;wBAAOC,SAAS,IAAMnB,YAAY,CAACoB,IAAM,CAACA;wBAAIH,MAAK;kCACjDlB,WAAW,SAAS;;;;;;AAK/B,EAAC;AAED,eAAeZ,YAAW"}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Admin UI: a small "send test email" tool for the SiteIntegrations email tab.
|
||||||
|
* Enter an address, click Send, and it POSTs to /api/ipal/test-email, which
|
||||||
|
* sends through the currently-selected transport (SMTP or Graph). Shows the
|
||||||
|
* result inline so you can confirm delivery — or read the exact error — without
|
||||||
|
* leaving the panel.
|
||||||
|
*
|
||||||
|
* Assigned via a `ui` field's admin.components.Field.
|
||||||
|
*/
|
||||||
|
export declare const TestEmailButton: () => import("react/jsx-runtime").JSX.Element;
|
||||||
|
export default TestEmailButton;
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
'use client';
|
||||||
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||||
|
import { useState } from 'react';
|
||||||
|
/**
|
||||||
|
* Admin UI: a small "send test email" tool for the SiteIntegrations email tab.
|
||||||
|
* Enter an address, click Send, and it POSTs to /api/ipal/test-email, which
|
||||||
|
* sends through the currently-selected transport (SMTP or Graph). Shows the
|
||||||
|
* result inline so you can confirm delivery — or read the exact error — without
|
||||||
|
* leaving the panel.
|
||||||
|
*
|
||||||
|
* Assigned via a `ui` field's admin.components.Field.
|
||||||
|
*/ export const TestEmailButton = ()=>{
|
||||||
|
const [to, setTo] = useState('');
|
||||||
|
const [status, setStatus] = useState({
|
||||||
|
kind: 'idle'
|
||||||
|
});
|
||||||
|
const send = async ()=>{
|
||||||
|
if (!to.trim()) {
|
||||||
|
setStatus({
|
||||||
|
kind: 'error',
|
||||||
|
msg: 'Enter a recipient address.'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setStatus({
|
||||||
|
kind: 'sending'
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
const res = await fetch('/api/ipal/test-email', {
|
||||||
|
body: JSON.stringify({
|
||||||
|
to: to.trim()
|
||||||
|
}),
|
||||||
|
credentials: 'include',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
method: 'POST'
|
||||||
|
});
|
||||||
|
const data = await res.json();
|
||||||
|
if (data.ok) {
|
||||||
|
setStatus({
|
||||||
|
kind: 'ok',
|
||||||
|
msg: data.message ?? 'Test email sent.'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setStatus({
|
||||||
|
kind: 'error',
|
||||||
|
msg: data.error ?? 'Send failed.'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
setStatus({
|
||||||
|
kind: 'error',
|
||||||
|
msg: 'Request failed. Is the server running?'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return /*#__PURE__*/ _jsxs("div", {
|
||||||
|
className: "field-type",
|
||||||
|
style: {
|
||||||
|
marginTop: '1rem'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
/*#__PURE__*/ _jsx("label", {
|
||||||
|
className: "field-label",
|
||||||
|
children: "Send a test email"
|
||||||
|
}),
|
||||||
|
/*#__PURE__*/ _jsx("p", {
|
||||||
|
style: {
|
||||||
|
fontSize: '.85rem',
|
||||||
|
marginTop: 0,
|
||||||
|
opacity: 0.7
|
||||||
|
},
|
||||||
|
children: "Sends through the transport selected above. Save your changes first."
|
||||||
|
}),
|
||||||
|
/*#__PURE__*/ _jsxs("div", {
|
||||||
|
style: {
|
||||||
|
alignItems: 'center',
|
||||||
|
display: 'flex',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
gap: '.5rem'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
/*#__PURE__*/ _jsx("input", {
|
||||||
|
onChange: (e)=>setTo(e.target.value),
|
||||||
|
placeholder: "[email protected]",
|
||||||
|
style: {
|
||||||
|
flex: 1,
|
||||||
|
minWidth: '220px'
|
||||||
|
},
|
||||||
|
type: "email",
|
||||||
|
value: to
|
||||||
|
}),
|
||||||
|
/*#__PURE__*/ _jsx("button", {
|
||||||
|
className: "btn btn--style-secondary",
|
||||||
|
disabled: status.kind === 'sending',
|
||||||
|
onClick: send,
|
||||||
|
style: {
|
||||||
|
whiteSpace: 'nowrap'
|
||||||
|
},
|
||||||
|
type: "button",
|
||||||
|
children: status.kind === 'sending' ? 'Sending…' : 'Send test'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
status.kind === 'ok' && /*#__PURE__*/ _jsxs("p", {
|
||||||
|
style: {
|
||||||
|
color: 'var(--theme-success-500, green)',
|
||||||
|
marginTop: '.5rem'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
"✓ ",
|
||||||
|
status.msg
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
status.kind === 'error' && /*#__PURE__*/ _jsxs("p", {
|
||||||
|
style: {
|
||||||
|
color: 'var(--theme-error-500, crimson)',
|
||||||
|
marginTop: '.5rem'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
"✗ ",
|
||||||
|
status.msg
|
||||||
|
]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
});
|
||||||
|
};
|
||||||
|
export default TestEmailButton;
|
||||||
|
|
||||||
|
//# sourceMappingURL=TestEmailButton.js.map
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/components/TestEmailButton.tsx"],"sourcesContent":["'use client'\n\nimport { useState } from 'react'\n\n/**\n * Admin UI: a small \"send test email\" tool for the SiteIntegrations email tab.\n * Enter an address, click Send, and it POSTs to /api/ipal/test-email, which\n * sends through the currently-selected transport (SMTP or Graph). Shows the\n * result inline so you can confirm delivery — or read the exact error — without\n * leaving the panel.\n *\n * Assigned via a `ui` field's admin.components.Field.\n */\nexport const TestEmailButton = () => {\n const [to, setTo] = useState('')\n const [status, setStatus] = useState<\n | { kind: 'error'; msg: string }\n | { kind: 'idle' }\n | { kind: 'ok'; msg: string }\n | { kind: 'sending' }\n >({ kind: 'idle' })\n\n const send = async () => {\n if (!to.trim()) {\n setStatus({ kind: 'error', msg: 'Enter a recipient address.' })\n return\n }\n setStatus({ kind: 'sending' })\n try {\n const res = await fetch('/api/ipal/test-email', {\n body: JSON.stringify({ to: to.trim() }),\n credentials: 'include',\n headers: { 'Content-Type': 'application/json' },\n method: 'POST',\n })\n const data = await res.json()\n if (data.ok) {\n setStatus({ kind: 'ok', msg: data.message ?? 'Test email sent.' })\n } else {\n setStatus({ kind: 'error', msg: data.error ?? 'Send failed.' })\n }\n } catch {\n setStatus({ kind: 'error', msg: 'Request failed. Is the server running?' })\n }\n }\n\n return (\n <div className=\"field-type\" style={{ marginTop: '1rem' }}>\n <label className=\"field-label\">Send a test email</label>\n <p style={{ fontSize: '.85rem', marginTop: 0, opacity: 0.7 }}>\n Sends through the transport selected above. Save your changes first.\n </p>\n <div style={{ alignItems: 'center', display: 'flex', flexWrap: 'wrap', gap: '.5rem' }}>\n <input\n onChange={(e) => setTo(e.target.value)}\n placeholder=\"[email protected]\"\n style={{ flex: 1, minWidth: '220px' }}\n type=\"email\"\n value={to}\n />\n <button\n className=\"btn btn--style-secondary\"\n disabled={status.kind === 'sending'}\n onClick={send}\n style={{ whiteSpace: 'nowrap' }}\n type=\"button\"\n >\n {status.kind === 'sending' ? 'Sending…' : 'Send test'}\n </button>\n </div>\n {status.kind === 'ok' && (\n <p style={{ color: 'var(--theme-success-500, green)', marginTop: '.5rem' }}>\n ✓ {status.msg}\n </p>\n )}\n {status.kind === 'error' && (\n <p style={{ color: 'var(--theme-error-500, crimson)', marginTop: '.5rem' }}>\n ✗ {status.msg}\n </p>\n )}\n </div>\n )\n}\n\nexport default TestEmailButton\n"],"names":["useState","TestEmailButton","to","setTo","status","setStatus","kind","send","trim","msg","res","fetch","body","JSON","stringify","credentials","headers","method","data","json","ok","message","error","div","className","style","marginTop","label","p","fontSize","opacity","alignItems","display","flexWrap","gap","input","onChange","e","target","value","placeholder","flex","minWidth","type","button","disabled","onClick","whiteSpace","color"],"mappings":"AAAA;;AAEA,SAASA,QAAQ,QAAQ,QAAO;AAEhC;;;;;;;;CAQC,GACD,OAAO,MAAMC,kBAAkB;IAC7B,MAAM,CAACC,IAAIC,MAAM,GAAGH,SAAS;IAC7B,MAAM,CAACI,QAAQC,UAAU,GAAGL,SAK1B;QAAEM,MAAM;IAAO;IAEjB,MAAMC,OAAO;QACX,IAAI,CAACL,GAAGM,IAAI,IAAI;YACdH,UAAU;gBAAEC,MAAM;gBAASG,KAAK;YAA6B;YAC7D;QACF;QACAJ,UAAU;YAAEC,MAAM;QAAU;QAC5B,IAAI;YACF,MAAMI,MAAM,MAAMC,MAAM,wBAAwB;gBAC9CC,MAAMC,KAAKC,SAAS,CAAC;oBAAEZ,IAAIA,GAAGM,IAAI;gBAAG;gBACrCO,aAAa;gBACbC,SAAS;oBAAE,gBAAgB;gBAAmB;gBAC9CC,QAAQ;YACV;YACA,MAAMC,OAAO,MAAMR,IAAIS,IAAI;YAC3B,IAAID,KAAKE,EAAE,EAAE;gBACXf,UAAU;oBAAEC,MAAM;oBAAMG,KAAKS,KAAKG,OAAO,IAAI;gBAAmB;YAClE,OAAO;gBACLhB,UAAU;oBAAEC,MAAM;oBAASG,KAAKS,KAAKI,KAAK,IAAI;gBAAe;YAC/D;QACF,EAAE,OAAM;YACNjB,UAAU;gBAAEC,MAAM;gBAASG,KAAK;YAAyC;QAC3E;IACF;IAEA,qBACE,MAACc;QAAIC,WAAU;QAAaC,OAAO;YAAEC,WAAW;QAAO;;0BACrD,KAACC;gBAAMH,WAAU;0BAAc;;0BAC/B,KAACI;gBAAEH,OAAO;oBAAEI,UAAU;oBAAUH,WAAW;oBAAGI,SAAS;gBAAI;0BAAG;;0BAG9D,MAACP;gBAAIE,OAAO;oBAAEM,YAAY;oBAAUC,SAAS;oBAAQC,UAAU;oBAAQC,KAAK;gBAAQ;;kCAClF,KAACC;wBACCC,UAAU,CAACC,IAAMlC,MAAMkC,EAAEC,MAAM,CAACC,KAAK;wBACrCC,aAAY;wBACZf,OAAO;4BAAEgB,MAAM;4BAAGC,UAAU;wBAAQ;wBACpCC,MAAK;wBACLJ,OAAOrC;;kCAET,KAAC0C;wBACCpB,WAAU;wBACVqB,UAAUzC,OAAOE,IAAI,KAAK;wBAC1BwC,SAASvC;wBACTkB,OAAO;4BAAEsB,YAAY;wBAAS;wBAC9BJ,MAAK;kCAEJvC,OAAOE,IAAI,KAAK,YAAY,aAAa;;;;YAG7CF,OAAOE,IAAI,KAAK,sBACf,MAACsB;gBAAEH,OAAO;oBAAEuB,OAAO;oBAAmCtB,WAAW;gBAAQ;;oBAAG;oBACvEtB,OAAOK,GAAG;;;YAGhBL,OAAOE,IAAI,KAAK,yBACf,MAACsB;gBAAEH,OAAO;oBAAEuB,OAAO;oBAAmCtB,WAAW;gBAAQ;;oBAAG;oBACvEtB,OAAOK,GAAG;;;;;AAKvB,EAAC;AAED,eAAeR,gBAAe"}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
/**
|
|
||||||
* Analytics configuration — GA4 measurement ID and GTM container ID.
|
|
||||||
* IDs are public (exposed client-side), so no read restriction needed.
|
|
||||||
*/ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=analytics.d.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["analytics.d.ts"],"sourcesContent":["import type { Field } from 'payload';\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 declare const analyticsFields: Field[];\n"],"names":[],"mappings":"AACA;;;CAGC,GACD,WAA8C"}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/**
|
|
||||||
* SMTP transport settings for outbound email.
|
|
||||||
*
|
|
||||||
* Protected at the global level (SiteIntegrations requires an authenticated
|
|
||||||
* user), so all fields — including the password — stay editable in the admin
|
|
||||||
* panel while remaining inaccessible to anonymous API requests.
|
|
||||||
*/ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=smtp.d.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["smtp.d.ts"],"sourcesContent":["import type { Field } from 'payload';\n/**\n * SMTP transport settings for outbound email.\n *\n * Protected at the global level (SiteIntegrations requires an authenticated\n * user), so all fields — including the password — stay editable in the admin\n * panel while remaining inaccessible to anonymous API requests.\n */\nexport declare const smtpFields: Field[];\n"],"names":[],"mappings":"AACA;;;;;;CAMC,GACD,WAAyC"}
|
|
||||||
+36
-1
@@ -5,8 +5,30 @@
|
|||||||
* user), so all fields — including the password — stay editable in the admin
|
* user), so all fields — including the password — stay editable in the admin
|
||||||
* panel while remaining inaccessible to anonymous API requests.
|
* panel while remaining inaccessible to anonymous API requests.
|
||||||
*/ export const smtpFields = [
|
*/ export const smtpFields = [
|
||||||
|
{
|
||||||
|
name: 'emailTransport',
|
||||||
|
type: 'select',
|
||||||
|
admin: {
|
||||||
|
description: 'How outbound email is sent. "Microsoft Graph" is only available when configured by the administrator (Intecion).'
|
||||||
|
},
|
||||||
|
defaultValue: 'smtp',
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: 'SMTP',
|
||||||
|
value: 'smtp'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Microsoft Graph (Exchange)',
|
||||||
|
value: 'graph'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'row',
|
type: 'row',
|
||||||
|
admin: {
|
||||||
|
// Hide SMTP fields when Graph is selected — they're not used then.
|
||||||
|
condition: (_, siblingData)=>siblingData?.emailTransport !== 'graph'
|
||||||
|
},
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: 'smtpHost',
|
name: 'smtpHost',
|
||||||
@@ -37,7 +59,11 @@
|
|||||||
name: 'smtpPassword',
|
name: 'smtpPassword',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
admin: {
|
admin: {
|
||||||
description: 'SMTP account password.'
|
description: 'SMTP account password.',
|
||||||
|
// Masked in the UI (••••) — stored plaintext, readable for SMTP auth.
|
||||||
|
components: {
|
||||||
|
Field: '@intecion/ipal-kit/client#MaskedField'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -53,6 +79,15 @@
|
|||||||
admin: {
|
admin: {
|
||||||
description: 'Default "from" display name.'
|
description: 'Default "from" display name.'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'emailTest',
|
||||||
|
type: 'ui',
|
||||||
|
admin: {
|
||||||
|
components: {
|
||||||
|
Field: '@intecion/ipal-kit/client#TestEmailButton'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/smtp.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * SMTP transport settings for outbound email.\n *\n * Protected at the global level (SiteIntegrations requires an authenticated\n * user), so all fields — including the password — stay editable in the admin\n * panel while remaining inaccessible to anonymous API requests.\n */\nexport const smtpFields: Field[] = [\n {\n type: 'row',\n fields: [\n {\n name: 'smtpHost',\n type: 'text',\n admin: { placeholder: 'smtp.example.com', width: '70%' },\n },\n {\n name: 'smtpPort',\n type: 'number',\n admin: { width: '30%' },\n defaultValue: 587,\n },\n ],\n },\n {\n name: 'smtpUser',\n type: 'text',\n admin: {\n description: 'SMTP account username.',\n },\n },\n {\n name: 'smtpPassword',\n type: 'text',\n admin: {\n description: 'SMTP account password.',\n },\n },\n {\n name: 'smtpFromAddress',\n type: 'email',\n admin: {\n description: 'Default \"from\" address for outgoing mail.',\n },\n },\n {\n name: 'smtpFromName',\n type: 'text',\n admin: {\n description: 'Default \"from\" display name.',\n },\n },\n]\n"],"names":["smtpFields","type","fields","name","admin","placeholder","width","defaultValue","description"],"mappings":"AAEA;;;;;;CAMC,GACD,OAAO,MAAMA,aAAsB;IACjC;QACEC,MAAM;QACNC,QAAQ;YACN;gBACEC,MAAM;gBACNF,MAAM;gBACNG,OAAO;oBAAEC,aAAa;oBAAoBC,OAAO;gBAAM;YACzD;YACA;gBACEH,MAAM;gBACNF,MAAM;gBACNG,OAAO;oBAAEE,OAAO;gBAAM;gBACtBC,cAAc;YAChB;SACD;IACH;IACA;QACEJ,MAAM;QACNF,MAAM;QACNG,OAAO;YACLI,aAAa;QACf;IACF;IACA;QACEL,MAAM;QACNF,MAAM;QACNG,OAAO;YACLI,aAAa;QACf;IACF;IACA;QACEL,MAAM;QACNF,MAAM;QACNG,OAAO;YACLI,aAAa;QACf;IACF;IACA;QACEL,MAAM;QACNF,MAAM;QACNG,OAAO;YACLI,aAAa;QACf;IACF;CACD,CAAA"}
|
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/smtp.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * SMTP transport settings for outbound email.\n *\n * Protected at the global level (SiteIntegrations requires an authenticated\n * user), so all fields — including the password — stay editable in the admin\n * panel while remaining inaccessible to anonymous API requests.\n */\nexport const smtpFields: Field[] = [\n {\n name: 'emailTransport',\n type: 'select',\n admin: {\n description:\n 'How outbound email is sent. \"Microsoft Graph\" is only available when configured by the administrator (Intecion).',\n // The Graph option only makes sense when agency credentials exist in env.\n // We can't read process.env in the admin UI directly, so a client project\n // that hasn't set up Graph should filter this option via integrationsFields\n // override, or simply leave it on 'smtp'. The adapter enforces the real\n // availability at send time regardless of what's selected here.\n },\n defaultValue: 'smtp',\n options: [\n { label: 'SMTP', value: 'smtp' },\n { label: 'Microsoft Graph (Exchange)', value: 'graph' },\n ],\n },\n {\n type: 'row',\n admin: {\n // Hide SMTP fields when Graph is selected — they're not used then.\n condition: (_, siblingData) => siblingData?.emailTransport !== 'graph',\n },\n fields: [\n {\n name: 'smtpHost',\n type: 'text',\n admin: { placeholder: 'smtp.example.com', width: '70%' },\n },\n {\n name: 'smtpPort',\n type: 'number',\n admin: { width: '30%' },\n defaultValue: 587,\n },\n ],\n },\n {\n name: 'smtpUser',\n type: 'text',\n admin: {\n description: 'SMTP account username.',\n },\n },\n {\n name: 'smtpPassword',\n type: 'text',\n admin: {\n description: 'SMTP account password.',\n // Masked in the UI (••••) — stored plaintext, readable for SMTP auth.\n components: {\n Field: '@intecion/ipal-kit/client#MaskedField',\n },\n },\n },\n {\n name: 'smtpFromAddress',\n type: 'email',\n admin: {\n description: 'Default \"from\" address for outgoing mail.',\n },\n },\n {\n name: 'smtpFromName',\n type: 'text',\n admin: {\n description: 'Default \"from\" display name.',\n },\n },\n {\n name: 'emailTest',\n type: 'ui',\n admin: {\n components: {\n Field: '@intecion/ipal-kit/client#TestEmailButton',\n },\n },\n },\n]\n"],"names":["smtpFields","name","type","admin","description","defaultValue","options","label","value","condition","_","siblingData","emailTransport","fields","placeholder","width","components","Field"],"mappings":"AAEA;;;;;;CAMC,GACD,OAAO,MAAMA,aAAsB;IACjC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QAMJ;QACAC,cAAc;QACdC,SAAS;YACP;gBAAEC,OAAO;gBAAQC,OAAO;YAAO;YAC/B;gBAAED,OAAO;gBAA8BC,OAAO;YAAQ;SACvD;IACH;IACA;QACEN,MAAM;QACNC,OAAO;YACL,mEAAmE;YACnEM,WAAW,CAACC,GAAGC,cAAgBA,aAAaC,mBAAmB;QACjE;QACAC,QAAQ;YACN;gBACEZ,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEW,aAAa;oBAAoBC,OAAO;gBAAM;YACzD;YACA;gBACEd,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEY,OAAO;gBAAM;gBACtBV,cAAc;YAChB;SACD;IACH;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACb,sEAAsE;YACtEY,YAAY;gBACVC,OAAO;YACT;QACF;IACF;IACA;QACEhB,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLa,YAAY;gBACVC,OAAO;YACT;QACF;IACF;CACD,CAAA"}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
/**
|
|
||||||
* Cloudflare R2 storage credentials.
|
|
||||||
* Reserved for future use — media offloading to R2.
|
|
||||||
*
|
|
||||||
* Protected at the global level (SiteIntegrations requires an authenticated
|
|
||||||
* user), so the access keys stay editable in the admin panel while remaining
|
|
||||||
* inaccessible to anonymous API requests.
|
|
||||||
*/ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=storage.d.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["storage.d.ts"],"sourcesContent":["import type { Field } from 'payload';\n/**\n * Cloudflare R2 storage credentials.\n * Reserved for future use — media offloading to R2.\n *\n * Protected at the global level (SiteIntegrations requires an authenticated\n * user), so the access keys stay editable in the admin panel while remaining\n * inaccessible to anonymous API requests.\n */\nexport declare const storageFields: Field[];\n"],"names":[],"mappings":"AACA;;;;;;;CAOC,GACD,WAA4C"}
|
|
||||||
+5
-1
@@ -31,7 +31,11 @@
|
|||||||
name: 'r2SecretAccessKey',
|
name: 'r2SecretAccessKey',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
admin: {
|
admin: {
|
||||||
description: 'R2 secret access key.'
|
description: 'R2 secret access key.',
|
||||||
|
// Masked in the UI (••••) — stored plaintext, readable for R2 auth.
|
||||||
|
components: {
|
||||||
|
Field: '@intecion/ipal-kit/client#MaskedField'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/storage.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Cloudflare R2 storage credentials.\n * Reserved for future use — media offloading to R2.\n *\n * Protected at the global level (SiteIntegrations requires an authenticated\n * user), so the access keys stay editable in the admin panel while remaining\n * inaccessible to anonymous API requests.\n */\nexport const storageFields: Field[] = [\n {\n name: 'r2Bucket',\n type: 'text',\n admin: {\n description: 'R2 bucket name.',\n },\n },\n {\n name: 'r2Endpoint',\n type: 'text',\n admin: {\n description: 'R2 S3-compatible endpoint URL.',\n },\n },\n {\n name: 'r2AccessKeyId',\n type: 'text',\n admin: {\n description: 'R2 access key ID.',\n },\n },\n {\n name: 'r2SecretAccessKey',\n type: 'text',\n admin: {\n description: 'R2 secret access key.',\n },\n },\n]\n"],"names":["storageFields","name","type","admin","description"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,gBAAyB;IACpC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;CACD,CAAA"}
|
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/storage.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Cloudflare R2 storage credentials.\n * Reserved for future use — media offloading to R2.\n *\n * Protected at the global level (SiteIntegrations requires an authenticated\n * user), so the access keys stay editable in the admin panel while remaining\n * inaccessible to anonymous API requests.\n */\nexport const storageFields: Field[] = [\n {\n name: 'r2Bucket',\n type: 'text',\n admin: {\n description: 'R2 bucket name.',\n },\n },\n {\n name: 'r2Endpoint',\n type: 'text',\n admin: {\n description: 'R2 S3-compatible endpoint URL.',\n },\n },\n {\n name: 'r2AccessKeyId',\n type: 'text',\n admin: {\n description: 'R2 access key ID.',\n },\n },\n {\n name: 'r2SecretAccessKey',\n type: 'text',\n admin: {\n description: 'R2 secret access key.',\n // Masked in the UI (••••) — stored plaintext, readable for R2 auth.\n components: {\n Field: '@intecion/ipal-kit/client#MaskedField',\n },\n },\n },\n]\n"],"names":["storageFields","name","type","admin","description","components","Field"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,gBAAyB;IACpC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACb,oEAAoE;YACpEC,YAAY;gBACVC,OAAO;YACT;QACF;IACF;CACD,CAAA"}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
/**
|
|
||||||
* Cloudflare Turnstile credentials.
|
|
||||||
*
|
|
||||||
* siteKey is public (rendered in the widget); secretKey is used for
|
|
||||||
* server-side verification. Both are protected at the global level
|
|
||||||
* (SiteIntegrations requires an authenticated user) rather than per-field,
|
|
||||||
* so they remain editable in the admin panel.
|
|
||||||
*/ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=turnstile.d.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["turnstile.d.ts"],"sourcesContent":["import type { Field } from 'payload';\n/**\n * Cloudflare Turnstile credentials.\n *\n * siteKey is public (rendered in the widget); secretKey is used for\n * server-side verification. Both are protected at the global level\n * (SiteIntegrations requires an authenticated user) rather than per-field,\n * so they remain editable in the admin panel.\n */\nexport declare const turnstileFields: Field[];\n"],"names":[],"mappings":"AACA;;;;;;;CAOC,GACD,WAA8C"}
|
|
||||||
+5
-1
@@ -17,7 +17,11 @@
|
|||||||
name: 'turnstileSecretKey',
|
name: 'turnstileSecretKey',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
admin: {
|
admin: {
|
||||||
description: 'Secret key used for server-side verification.'
|
description: 'Secret key used for server-side verification.',
|
||||||
|
// Masked in the UI (••••) — stored plaintext, readable for verification.
|
||||||
|
components: {
|
||||||
|
Field: '@intecion/ipal-kit/client#MaskedField'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/turnstile.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Cloudflare Turnstile credentials.\n *\n * siteKey is public (rendered in the widget); secretKey is used for\n * server-side verification. Both are protected at the global level\n * (SiteIntegrations requires an authenticated user) rather than per-field,\n * so they remain editable in the admin panel.\n */\nexport const turnstileFields: Field[] = [\n {\n name: 'turnstileSiteKey',\n type: 'text',\n admin: {\n description: 'Public site key rendered in the Turnstile widget.',\n },\n },\n {\n name: 'turnstileSecretKey',\n type: 'text',\n admin: {\n description: 'Secret key used for server-side verification.',\n },\n },\n]\n"],"names":["turnstileFields","name","type","admin","description"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,kBAA2B;IACtC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;CACD,CAAA"}
|
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/turnstile.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Cloudflare Turnstile credentials.\n *\n * siteKey is public (rendered in the widget); secretKey is used for\n * server-side verification. Both are protected at the global level\n * (SiteIntegrations requires an authenticated user) rather than per-field,\n * so they remain editable in the admin panel.\n */\nexport const turnstileFields: Field[] = [\n {\n name: 'turnstileSiteKey',\n type: 'text',\n admin: {\n description: 'Public site key rendered in the Turnstile widget.',\n },\n },\n {\n name: 'turnstileSecretKey',\n type: 'text',\n admin: {\n description: 'Secret key used for server-side verification.',\n // Masked in the UI (••••) — stored plaintext, readable for verification.\n components: {\n Field: '@intecion/ipal-kit/client#MaskedField',\n },\n },\n },\n]\n"],"names":["turnstileFields","name","type","admin","description","components","Field"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,kBAA2B;IACtC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACb,yEAAyE;YACzEC,YAAY;gBACVC,OAAO;YACT;QACF;IACF;CACD,CAAA"}
|
||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=index.d.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["index.d.ts"],"sourcesContent":["import type { Field, GlobalConfig } from 'payload';\ntype BuildSiteIntegrationsArgs = {\n /** Extra fields injected by the client project */\n additionalFields?: Field[];\n};\n/**\n * Builds the SiteIntegrations global.\n *\n * Holds third-party service credentials. Access is enforced at the global\n * level — the whole global requires an authenticated user — so secrets stay\n * out of anonymous API responses while remaining editable in the admin panel\n * and readable via the server-side Local API. (Field-level read:false was\n * avoided because it also hides fields from the admin UI, making them\n * impossible to enter.)\n *\n * Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).\n */\nexport declare function buildSiteIntegrations({ additionalFields, }?: BuildSiteIntegrationsArgs): GlobalConfig;\nexport {};\n"],"names":[],"mappings":"AAkBA,WAAU"}
|
|
||||||
+4
@@ -14,6 +14,10 @@ type BuildSiteIntegrationsArgs = {
|
|||||||
* impossible to enter.)
|
* impossible to enter.)
|
||||||
*
|
*
|
||||||
* Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).
|
* Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).
|
||||||
|
*
|
||||||
|
* Note: R2 storage credentials are NOT here — storage is infrastructure and
|
||||||
|
* binds at boot, so its config lives in .env (R2_BUCKET, R2_ENDPOINT, ...),
|
||||||
|
* consumed by buildR2Storage. See docs/storage.md.
|
||||||
*/
|
*/
|
||||||
export declare function buildSiteIntegrations({ additionalFields, }?: BuildSiteIntegrationsArgs): GlobalConfig;
|
export declare function buildSiteIntegrations({ additionalFields, }?: BuildSiteIntegrationsArgs): GlobalConfig;
|
||||||
export {};
|
export {};
|
||||||
|
|||||||
+4
-5
@@ -1,7 +1,6 @@
|
|||||||
import { isAdmin } from '../../modules/access/index.js';
|
import { isAdmin } from '../../modules/access/index.js';
|
||||||
import { analyticsFields } from './fields/analytics.js';
|
import { analyticsFields } from './fields/analytics.js';
|
||||||
import { smtpFields } from './fields/smtp.js';
|
import { smtpFields } from './fields/smtp.js';
|
||||||
import { storageFields } from './fields/storage.js';
|
|
||||||
import { turnstileFields } from './fields/turnstile.js';
|
import { turnstileFields } from './fields/turnstile.js';
|
||||||
/**
|
/**
|
||||||
* Builds the SiteIntegrations global.
|
* Builds the SiteIntegrations global.
|
||||||
@@ -14,6 +13,10 @@ import { turnstileFields } from './fields/turnstile.js';
|
|||||||
* impossible to enter.)
|
* impossible to enter.)
|
||||||
*
|
*
|
||||||
* Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).
|
* Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).
|
||||||
|
*
|
||||||
|
* Note: R2 storage credentials are NOT here — storage is infrastructure and
|
||||||
|
* binds at boot, so its config lives in .env (R2_BUCKET, R2_ENDPOINT, ...),
|
||||||
|
* consumed by buildR2Storage. See docs/storage.md.
|
||||||
*/ export function buildSiteIntegrations({ additionalFields } = {}) {
|
*/ export function buildSiteIntegrations({ additionalFields } = {}) {
|
||||||
return {
|
return {
|
||||||
slug: 'site-integrations',
|
slug: 'site-integrations',
|
||||||
@@ -42,10 +45,6 @@ import { turnstileFields } from './fields/turnstile.js';
|
|||||||
fields: smtpFields,
|
fields: smtpFields,
|
||||||
label: 'SMTP'
|
label: 'SMTP'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
fields: storageFields,
|
|
||||||
label: 'Storage'
|
|
||||||
},
|
|
||||||
...additionalFields?.length ? [
|
...additionalFields?.length ? [
|
||||||
{
|
{
|
||||||
fields: additionalFields,
|
fields: additionalFields,
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../src/globals/SiteIntegrations/index.ts"],"sourcesContent":["import type { Field, GlobalConfig } from 'payload'\n\nimport { isAdmin } from '../../modules/access/index.js'\nimport { analyticsFields } from './fields/analytics.js'\nimport { smtpFields } from './fields/smtp.js'\nimport { storageFields } from './fields/storage.js'\nimport { turnstileFields } from './fields/turnstile.js'\n\ntype BuildSiteIntegrationsArgs = {\n /** Extra fields injected by the client project */\n additionalFields?: Field[]\n}\n\n/**\n * Builds the SiteIntegrations global.\n *\n * Holds third-party service credentials. Access is enforced at the global\n * level — the whole global requires an authenticated user — so secrets stay\n * out of anonymous API responses while remaining editable in the admin panel\n * and readable via the server-side Local API. (Field-level read:false was\n * avoided because it also hides fields from the admin UI, making them\n * impossible to enter.)\n *\n * Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).\n */\nexport function buildSiteIntegrations({\n additionalFields,\n}: BuildSiteIntegrationsArgs = {}): GlobalConfig {\n return {\n slug: 'site-integrations',\n access: {\n // Admin-only — secrets live here. Anonymous and non-admin users get\n // nothing through the API; admins read/edit in the panel and via Local API.\n read: ({ req: { user } }) => isAdmin(user),\n update: ({ req: { user } }) => isAdmin(user),\n },\n admin: {\n group: 'Settings',\n },\n fields: [\n {\n type: 'tabs',\n tabs: [\n { fields: analyticsFields, label: 'Analytics' },\n { fields: turnstileFields, label: 'Turnstile' },\n { fields: smtpFields, label: 'SMTP' },\n { fields: storageFields, label: 'Storage' },\n ...(additionalFields?.length ? [{ fields: additionalFields, label: 'Custom' }] : []),\n ],\n },\n ],\n label: 'Site Integrations',\n }\n}\n"],"names":["isAdmin","analyticsFields","smtpFields","storageFields","turnstileFields","buildSiteIntegrations","additionalFields","slug","access","read","req","user","update","admin","group","fields","type","tabs","label","length"],"mappings":"AAEA,SAASA,OAAO,QAAQ,gCAA+B;AACvD,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,UAAU,QAAQ,mBAAkB;AAC7C,SAASC,aAAa,QAAQ,sBAAqB;AACnD,SAASC,eAAe,QAAQ,wBAAuB;AAOvD;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,sBAAsB,EACpCC,gBAAgB,EACU,GAAG,CAAC,CAAC;IAC/B,OAAO;QACLC,MAAM;QACNC,QAAQ;YACN,oEAAoE;YACpE,4EAA4E;YAC5EC,MAAM,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKX,QAAQW;YACrCC,QAAQ,CAAC,EAAEF,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKX,QAAQW;QACzC;QACAE,OAAO;YACLC,OAAO;QACT;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;oBACJ;wBAAEF,QAAQd;wBAAiBiB,OAAO;oBAAY;oBAC9C;wBAAEH,QAAQX;wBAAiBc,OAAO;oBAAY;oBAC9C;wBAAEH,QAAQb;wBAAYgB,OAAO;oBAAO;oBACpC;wBAAEH,QAAQZ;wBAAee,OAAO;oBAAU;uBACtCZ,kBAAkBa,SAAS;wBAAC;4BAAEJ,QAAQT;4BAAkBY,OAAO;wBAAS;qBAAE,GAAG,EAAE;iBACpF;YACH;SACD;QACDA,OAAO;IACT;AACF"}
|
{"version":3,"sources":["../../../src/globals/SiteIntegrations/index.ts"],"sourcesContent":["import type { Field, GlobalConfig } from 'payload'\n\nimport { isAdmin } from '../../modules/access/index.js'\nimport { analyticsFields } from './fields/analytics.js'\nimport { smtpFields } from './fields/smtp.js'\nimport { turnstileFields } from './fields/turnstile.js'\n\ntype BuildSiteIntegrationsArgs = {\n /** Extra fields injected by the client project */\n additionalFields?: Field[]\n}\n\n/**\n * Builds the SiteIntegrations global.\n *\n * Holds third-party service credentials. Access is enforced at the global\n * level — the whole global requires an authenticated user — so secrets stay\n * out of anonymous API responses while remaining editable in the admin panel\n * and readable via the server-side Local API. (Field-level read:false was\n * avoided because it also hides fields from the admin UI, making them\n * impossible to enter.)\n *\n * Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).\n *\n * Note: R2 storage credentials are NOT here — storage is infrastructure and\n * binds at boot, so its config lives in .env (R2_BUCKET, R2_ENDPOINT, ...),\n * consumed by buildR2Storage. See docs/storage.md.\n */\nexport function buildSiteIntegrations({\n additionalFields,\n}: BuildSiteIntegrationsArgs = {}): GlobalConfig {\n return {\n slug: 'site-integrations',\n access: {\n // Admin-only — secrets live here. Anonymous and non-admin users get\n // nothing through the API; admins read/edit in the panel and via Local API.\n read: ({ req: { user } }) => isAdmin(user),\n update: ({ req: { user } }) => isAdmin(user),\n },\n admin: {\n group: 'Settings',\n },\n fields: [\n {\n type: 'tabs',\n tabs: [\n { fields: analyticsFields, label: 'Analytics' },\n { fields: turnstileFields, label: 'Turnstile' },\n { fields: smtpFields, label: 'SMTP' },\n ...(additionalFields?.length ? [{ fields: additionalFields, label: 'Custom' }] : []),\n ],\n },\n ],\n label: 'Site Integrations',\n }\n}\n"],"names":["isAdmin","analyticsFields","smtpFields","turnstileFields","buildSiteIntegrations","additionalFields","slug","access","read","req","user","update","admin","group","fields","type","tabs","label","length"],"mappings":"AAEA,SAASA,OAAO,QAAQ,gCAA+B;AACvD,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,UAAU,QAAQ,mBAAkB;AAC7C,SAASC,eAAe,QAAQ,wBAAuB;AAOvD;;;;;;;;;;;;;;;CAeC,GACD,OAAO,SAASC,sBAAsB,EACpCC,gBAAgB,EACU,GAAG,CAAC,CAAC;IAC/B,OAAO;QACLC,MAAM;QACNC,QAAQ;YACN,oEAAoE;YACpE,4EAA4E;YAC5EC,MAAM,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKV,QAAQU;YACrCC,QAAQ,CAAC,EAAEF,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKV,QAAQU;QACzC;QACAE,OAAO;YACLC,OAAO;QACT;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;oBACJ;wBAAEF,QAAQb;wBAAiBgB,OAAO;oBAAY;oBAC9C;wBAAEH,QAAQX;wBAAiBc,OAAO;oBAAY;oBAC9C;wBAAEH,QAAQZ;wBAAYe,OAAO;oBAAO;uBAChCZ,kBAAkBa,SAAS;wBAAC;4BAAEJ,QAAQT;4BAAkBY,OAAO;wBAAS;qBAAE,GAAG,EAAE;iBACpF;YACH;SACD;QACDA,OAAO;IACT;AACF"}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
/**
|
|
||||||
* General site identity fields.
|
|
||||||
* Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo).
|
|
||||||
*/ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=general.d.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["general.d.ts"],"sourcesContent":["import type { Field } from 'payload';\n/**\n * General site identity fields.\n * Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo).\n */\nexport declare const generalFields: Field[];\n"],"names":[],"mappings":"AACA;;;CAGC,GACD,WAA4C"}
|
|
||||||
+16
-1
@@ -1,3 +1,4 @@
|
|||||||
|
import { validateFaviconField } from '../../../modules/seo/index.js';
|
||||||
/**
|
/**
|
||||||
* General site identity fields.
|
* General site identity fields.
|
||||||
* Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo).
|
* Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo).
|
||||||
@@ -11,6 +12,14 @@
|
|||||||
localized: true,
|
localized: true,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'siteDescription',
|
||||||
|
type: 'textarea',
|
||||||
|
admin: {
|
||||||
|
description: 'Fallback meta description when a page has none. Also used for llms.txt and Open Graph.'
|
||||||
|
},
|
||||||
|
localized: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'titleOrder',
|
name: 'titleOrder',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
@@ -79,7 +88,13 @@
|
|||||||
name: 'favicon',
|
name: 'favicon',
|
||||||
type: 'upload',
|
type: 'upload',
|
||||||
admin: {
|
admin: {
|
||||||
description: 'Square source icon (PNG or SVG) for the browser tab. Rendered by the frontend.'
|
description: 'Square icon, PNG or SVG, min. 48×48px (Google requires this to show it in search). Rendered via buildIconsMetadata.'
|
||||||
|
},
|
||||||
|
hooks: {
|
||||||
|
// Warn the editor if the favicon is too small / not square for Google.
|
||||||
|
beforeValidate: [
|
||||||
|
validateFaviconField
|
||||||
|
]
|
||||||
},
|
},
|
||||||
relationTo: 'media'
|
relationTo: 'media'
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/globals/SiteSettings/fields/general.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * General site identity fields.\n * Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo).\n */\nexport const generalFields: Field[] = [\n {\n name: 'siteName',\n type: 'text',\n admin: {\n description: 'Used in page titles and Open Graph metadata.',\n },\n localized: true,\n required: true,\n },\n {\n name: 'titleOrder',\n type: 'select',\n admin: {\n description: 'Which comes first in browser tabs.',\n },\n defaultValue: 'page-first',\n options: [\n { label: 'Page first — About Us | Acme', value: 'page-first' },\n { label: 'Site first — Acme | About Us', value: 'site-first' },\n ],\n },\n {\n name: 'titleSeparator',\n type: 'select',\n admin: {\n description: 'Separates the page title from the site name in browser tabs.',\n },\n defaultValue: '|',\n options: [\n { label: 'Pipe — Page | Site', value: '|' },\n { label: 'Dash — Page – Site', value: '–' },\n { label: 'Hyphen — Page - Site', value: '-' },\n { label: 'Bullet — Page · Site', value: '·' },\n { label: 'Slash — Page / Site', value: '/' },\n ],\n },\n {\n name: 'logo',\n type: 'upload',\n admin: {\n description: 'Primary site logo.',\n },\n relationTo: 'media',\n },\n {\n name: 'defaultShareImage',\n type: 'upload',\n admin: {\n description: 'Fallback Open Graph image when a page has none.',\n },\n relationTo: 'media',\n },\n {\n name: 'favicon',\n type: 'upload',\n admin: {\n description: 'Square source icon (PNG or SVG) for the browser tab. Rendered by the frontend.',\n },\n relationTo: 'media',\n },\n]\n"],"names":["generalFields","name","type","admin","description","localized","required","defaultValue","options","label","value","relationTo"],"mappings":"AAEA;;;CAGC,GACD,OAAO,MAAMA,gBAAyB;IACpC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAC,WAAW;QACXC,UAAU;IACZ;IACA;QACEL,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAG,cAAc;QACdC,SAAS;YACP;gBAAEC,OAAO;gBAAkCC,OAAO;YAAa;YAC/D;gBAAED,OAAO;gBAAkCC,OAAO;YAAa;SAChE;IACH;IACA;QACET,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAG,cAAc;QACdC,SAAS;YACP;gBAAEC,OAAO;gBAAwBC,OAAO;YAAI;YAC5C;gBAAED,OAAO;gBAAwBC,OAAO;YAAI;YAC5C;gBAAED,OAAO;gBAA0BC,OAAO;YAAI;YAC9C;gBAAED,OAAO;gBAA0BC,OAAO;YAAI;YAC9C;gBAAED,OAAO;gBAAyBC,OAAO;YAAI;SAC9C;IACH;IACA;QACET,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAO,YAAY;IACd;IACA;QACEV,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAO,YAAY;IACd;IACA;QACEV,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAO,YAAY;IACd;CACD,CAAA"}
|
{"version":3,"sources":["../../../../src/globals/SiteSettings/fields/general.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport { validateFaviconField } from '../../../modules/seo/index.js'\n\n/**\n * General site identity fields.\n * Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo).\n */\nexport const generalFields: Field[] = [\n {\n name: 'siteName',\n type: 'text',\n admin: {\n description: 'Used in page titles and Open Graph metadata.',\n },\n localized: true,\n required: true,\n },\n {\n name: 'siteDescription',\n type: 'textarea',\n admin: {\n description:\n 'Fallback meta description when a page has none. Also used for llms.txt and Open Graph.',\n },\n localized: true,\n },\n {\n name: 'titleOrder',\n type: 'select',\n admin: {\n description: 'Which comes first in browser tabs.',\n },\n defaultValue: 'page-first',\n options: [\n { label: 'Page first — About Us | Acme', value: 'page-first' },\n { label: 'Site first — Acme | About Us', value: 'site-first' },\n ],\n },\n {\n name: 'titleSeparator',\n type: 'select',\n admin: {\n description: 'Separates the page title from the site name in browser tabs.',\n },\n defaultValue: '|',\n options: [\n { label: 'Pipe — Page | Site', value: '|' },\n { label: 'Dash — Page – Site', value: '–' },\n { label: 'Hyphen — Page - Site', value: '-' },\n { label: 'Bullet — Page · Site', value: '·' },\n { label: 'Slash — Page / Site', value: '/' },\n ],\n },\n {\n name: 'logo',\n type: 'upload',\n admin: {\n description: 'Primary site logo.',\n },\n relationTo: 'media',\n },\n {\n name: 'defaultShareImage',\n type: 'upload',\n admin: {\n description: 'Fallback Open Graph image when a page has none.',\n },\n relationTo: 'media',\n },\n {\n name: 'favicon',\n type: 'upload',\n admin: {\n description:\n 'Square icon, PNG or SVG, min. 48×48px (Google requires this to show it in search). Rendered via buildIconsMetadata.',\n },\n hooks: {\n // Warn the editor if the favicon is too small / not square for Google.\n beforeValidate: [validateFaviconField],\n },\n relationTo: 'media',\n },\n]\n"],"names":["validateFaviconField","generalFields","name","type","admin","description","localized","required","defaultValue","options","label","value","relationTo","hooks","beforeValidate"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ,gCAA+B;AAEpE;;;CAGC,GACD,OAAO,MAAMC,gBAAyB;IACpC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAC,WAAW;QACXC,UAAU;IACZ;IACA;QACEL,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QACJ;QACAC,WAAW;IACb;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAG,cAAc;QACdC,SAAS;YACP;gBAAEC,OAAO;gBAAkCC,OAAO;YAAa;YAC/D;gBAAED,OAAO;gBAAkCC,OAAO;YAAa;SAChE;IACH;IACA;QACET,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAG,cAAc;QACdC,SAAS;YACP;gBAAEC,OAAO;gBAAwBC,OAAO;YAAI;YAC5C;gBAAED,OAAO;gBAAwBC,OAAO;YAAI;YAC5C;gBAAED,OAAO;gBAA0BC,OAAO;YAAI;YAC9C;gBAAED,OAAO;gBAA0BC,OAAO;YAAI;YAC9C;gBAAED,OAAO;gBAAyBC,OAAO;YAAI;SAC9C;IACH;IACA;QACET,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAO,YAAY;IACd;IACA;QACEV,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAO,YAAY;IACd;IACA;QACEV,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QACJ;QACAQ,OAAO;YACL,uEAAuE;YACvEC,gBAAgB;gBAACd;aAAqB;QACxC;QACAY,YAAY;IACd;CACD,CAAA"}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=navigation.d.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["navigation.d.ts"],"sourcesContent":["export {};\n"],"names":[],"mappings":"AAAA,WAAU"}
|
|
||||||
-9
@@ -1,9 +0,0 @@
|
|||||||
/**
|
|
||||||
* Theme behavior configuration.
|
|
||||||
*
|
|
||||||
* These are decisions, not visuals — the plugin stores them, the client
|
|
||||||
* template reads them and decides whether to render a toggle and which
|
|
||||||
* mode to start in. Appearance itself stays in the template.
|
|
||||||
*/ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=theme.d.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["theme.d.ts"],"sourcesContent":["import type { Field } from 'payload';\n/**\n * Theme behavior configuration.\n *\n * These are decisions, not visuals — the plugin stores them, the client\n * template reads them and decides whether to render a toggle and which\n * mode to start in. Appearance itself stays in the template.\n */\nexport declare const themeFields: Field[];\n"],"names":[],"mappings":"AACA;;;;;;CAMC,GACD,WAA0C"}
|
|
||||||
Vendored
-3
@@ -1,3 +0,0 @@
|
|||||||
export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=index.d.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["index.d.ts"],"sourcesContent":["import type { Field, GlobalConfig } from 'payload';\ntype BuildSiteSettingsArgs = {\n /** Extra fields injected by the client project */\n additionalFields?: Field[];\n /**\n * Fields for the \"System Pages\" tab — page assignments by role (homepage,\n * privacy policy, collection archives). Assembled by the caller, which is the\n * only place that knows which modules are enabled. The tab is omitted when\n * this is empty.\n */\n systemPageFields?: Field[];\n};\n/**\n * Builds the SiteSettings global.\n *\n * Composes tabs out of field groups; it deliberately doesn't know where those\n * groups come from. Earlier it imported the pages and content modules directly,\n * which meant a global — a presentation-layer concern — had an opinion about\n * blogs. Now the plugin's composition root passes fields in, and adding a new\n * kind of page assignment needs no change here.\n *\n * Uses unnamed tabs — data stays flat (siteSettings.siteName, not\n * siteSettings.general.siteName). Client-provided fields land in their own\n * \"Custom\" tab so core data paths never shift.\n */\nexport declare function buildSiteSettings({ additionalFields, systemPageFields, }?: BuildSiteSettingsArgs): GlobalConfig;\nexport {};\n"],"names":[],"mappings":"AA0BA,WAAU"}
|
|
||||||
Vendored
-17
@@ -1,17 +0,0 @@
|
|||||||
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY } from './modules/access/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, buildArchivePath, buildEntryPath, getArchiveEntries, parsePageParam, resolveRoute } from './modules/content/index.js';
|
|
||||||
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
|
||||||
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
|
||||||
export { createContentHelpers } from './modules/frontend/index.js';
|
|
||||||
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath } from './modules/i18n/index.js';
|
|
||||||
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from './modules/i18n/index.js';
|
|
||||||
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
|
|
||||||
export { getGlobal, getSiteIntegrations, getSiteSettings, SITE_INTEGRATIONS_SLUG, SITE_SETTINGS_SLUG } from './modules/payload/index.js';
|
|
||||||
export { buildHreflangAlternates, buildMetadata, composeTitle } from './modules/seo/index.js';
|
|
||||||
export { buildAutoFillMetaHook, buildRobots, buildSitemapEntries, createMetadataGenerator, createPageMetadata, injectAutoFillMeta } from './modules/seo/index.js';
|
|
||||||
export { buildSlugField, toSlug } from './modules/slug/index.js';
|
|
||||||
export { ipalKit } from './plugin.js';
|
|
||||||
|
|
||||||
//# sourceMappingURL=index.d.js.map
|
|
||||||
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+21
@@ -1,5 +1,7 @@
|
|||||||
export type { AccessOption, Role } from './modules/access/index.js';
|
export type { AccessOption, Role } from './modules/access/index.js';
|
||||||
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY, } from './modules/access/index.js';
|
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY, } from './modules/access/index.js';
|
||||||
|
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y, } from './modules/accessibility/index.js';
|
||||||
|
export type { A11yState } from './modules/accessibility/index.js';
|
||||||
export type { AnalyticsConfig } from './modules/analytics/index.js';
|
export type { AnalyticsConfig } from './modules/analytics/index.js';
|
||||||
export { getAnalyticsConfig } from './modules/analytics/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 { 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';
|
||||||
@@ -7,23 +9,42 @@ export type { ConsentCategory, ConsentState, ConsentTexts } from './modules/cons
|
|||||||
export type { ContentCollectionOption, ContentOption, ResolvedRoute, } from './modules/content/index.js';
|
export type { ContentCollectionOption, ContentOption, ResolvedRoute, } from './modules/content/index.js';
|
||||||
export { archiveFieldName, buildArchivePath, buildEntryPath, getArchiveEntries, parsePageParam, resolveRoute, } from './modules/content/index.js';
|
export { archiveFieldName, buildArchivePath, buildEntryPath, getArchiveEntries, parsePageParam, resolveRoute, } from './modules/content/index.js';
|
||||||
export type { ArchiveEntries } from './modules/content/index.js';
|
export type { ArchiveEntries } from './modules/content/index.js';
|
||||||
|
export { graphAdapter } from './modules/email/graphAdapter.js';
|
||||||
|
export type { GraphAdapterArgs } from './modules/email/graphAdapter.js';
|
||||||
|
export { mailAdapter } from './modules/email/mailAdapter.js';
|
||||||
|
export type { MailAdapterArgs } from './modules/email/mailAdapter.js';
|
||||||
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
||||||
export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js';
|
export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js';
|
||||||
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
||||||
export type { FormsCollectionOverrides, FormsFieldsOverride, FormsOption, } from './modules/forms/types.js';
|
export type { FormsCollectionOverrides, FormsFieldsOverride, FormsOption, } from './modules/forms/types.js';
|
||||||
export { createContentHelpers } from './modules/frontend/index.js';
|
export { createContentHelpers } from './modules/frontend/index.js';
|
||||||
|
export { buildPreventDeleteSystemPage, buildRevalidateHook, buildValidateUniqueRole, setPublishedAtHook, trackSlugHistoryHook, } from './modules/hooks/index.js';
|
||||||
export type { I18nConfig, LocaleDefinition, LocalizedSlugs } from './modules/i18n/index.js';
|
export type { I18nConfig, LocaleDefinition, LocalizedSlugs } from './modules/i18n/index.js';
|
||||||
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath, } from './modules/i18n/index.js';
|
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath, } from './modules/i18n/index.js';
|
||||||
export type { LocaleMiddlewareResult } from './modules/i18n/index.js';
|
export type { LocaleMiddlewareResult } from './modules/i18n/index.js';
|
||||||
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from './modules/i18n/index.js';
|
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from './modules/i18n/index.js';
|
||||||
|
export { normalizeFilename, normalizeFilenameHook } from './modules/media/index.js';
|
||||||
|
export { getNotificationTexts, NOTIFICATION_FALLBACK, resolveFormMessage, } from './modules/notifications/index.js';
|
||||||
|
export type { FormNotificationTexts, NotificationTexts } from './modules/notifications/index.js';
|
||||||
export type { PagesOption, SystemPageRole } from './modules/pages/index.js';
|
export type { PagesOption, SystemPageRole } from './modules/pages/index.js';
|
||||||
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
|
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
|
||||||
export type { GlobalQueryOptions } from './modules/payload/index.js';
|
export type { GlobalQueryOptions } from './modules/payload/index.js';
|
||||||
export { getGlobal, getSiteIntegrations, getSiteSettings, SITE_INTEGRATIONS_SLUG, SITE_SETTINGS_SLUG, } from './modules/payload/index.js';
|
export { getGlobal, getSiteIntegrations, getSiteSettings, SITE_INTEGRATIONS_SLUG, SITE_SETTINGS_SLUG, } from './modules/payload/index.js';
|
||||||
|
export { buildSecurityHeaders } from './modules/security/index.js';
|
||||||
|
export { buildCsp } from './modules/security/index.js';
|
||||||
|
export type { BuildCspArgs } from './modules/security/index.js';
|
||||||
|
export type { BuildSecurityHeadersArgs, SecurityHeader } from './modules/security/index.js';
|
||||||
export type { PageMetadata, SeoMeta, SeoOption } from './modules/seo/index.js';
|
export type { PageMetadata, SeoMeta, SeoOption } from './modules/seo/index.js';
|
||||||
export { buildHreflangAlternates, buildMetadata, composeTitle } from './modules/seo/index.js';
|
export { buildHreflangAlternates, buildMetadata, composeTitle } from './modules/seo/index.js';
|
||||||
export type { AutoFillMapping, RobotsRules, SitemapEntry } from './modules/seo/index.js';
|
export type { AutoFillMapping, RobotsRules, SitemapEntry } from './modules/seo/index.js';
|
||||||
export { buildAutoFillMetaHook, buildRobots, buildSitemapEntries, createMetadataGenerator, createPageMetadata, injectAutoFillMeta, } from './modules/seo/index.js';
|
export { buildAutoFillMetaHook, buildRobots, buildSitemapEntries, createMetadataGenerator, createPageMetadata, injectAutoFillMeta, } from './modules/seo/index.js';
|
||||||
|
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField, } from './modules/seo/index.js';
|
||||||
|
export { buildBreadcrumbJsonLd, buildSiteNavigationJsonLd, buildWebSiteJsonLd, } from './modules/seo/index.js';
|
||||||
|
export { buildFaqJsonLd, buildLocalBusinessJsonLd, buildServiceJsonLd, } from './modules/seo/index.js';
|
||||||
|
export { buildArticleJsonLd } from './modules/seo/index.js';
|
||||||
|
export { buildSitemapXml } from './modules/seo/index.js';
|
||||||
|
export { buildLlmsTxt } from './modules/seo/index.js';
|
||||||
export { buildSlugField, toSlug } from './modules/slug/index.js';
|
export { buildSlugField, toSlug } from './modules/slug/index.js';
|
||||||
|
export { buildR2Storage } from './modules/storage/index.js';
|
||||||
export { ipalKit } from './plugin.js';
|
export { ipalKit } from './plugin.js';
|
||||||
export type { IpalOptions } from './types.js';
|
export type { IpalOptions } from './types.js';
|
||||||
|
|||||||
Vendored
+16
@@ -1,20 +1,36 @@
|
|||||||
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY } from './modules/access/index.js';
|
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY } from './modules/access/index.js';
|
||||||
|
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js';
|
||||||
export { getAnalyticsConfig } from './modules/analytics/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 { 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, buildArchivePath, buildEntryPath, getArchiveEntries, parsePageParam, resolveRoute } from './modules/content/index.js';
|
export { archiveFieldName, buildArchivePath, buildEntryPath, getArchiveEntries, parsePageParam, resolveRoute } 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
|
// Imported straight from the file, NOT from ./modules/email/index.js — that
|
||||||
// barrel re-exports sendEmail, which imports 'server-only' and would crash when
|
// barrel re-exports sendEmail, which imports 'server-only' and would crash when
|
||||||
// Payload loads the config (or runs generate:importmap) as a plain Node script.
|
// Payload loads the config (or runs generate:importmap) as a plain Node script.
|
||||||
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
||||||
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
||||||
export { createContentHelpers } from './modules/frontend/index.js';
|
export { createContentHelpers } from './modules/frontend/index.js';
|
||||||
|
export { buildPreventDeleteSystemPage, buildRevalidateHook, buildValidateUniqueRole, setPublishedAtHook, trackSlugHistoryHook } from './modules/hooks/index.js';
|
||||||
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath } from './modules/i18n/index.js';
|
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath } from './modules/i18n/index.js';
|
||||||
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from './modules/i18n/index.js';
|
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from './modules/i18n/index.js';
|
||||||
|
export { normalizeFilename, normalizeFilenameHook } from './modules/media/index.js';
|
||||||
|
export { getNotificationTexts, NOTIFICATION_FALLBACK, resolveFormMessage } from './modules/notifications/index.js';
|
||||||
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
|
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
|
||||||
export { getGlobal, getSiteIntegrations, getSiteSettings, SITE_INTEGRATIONS_SLUG, SITE_SETTINGS_SLUG } from './modules/payload/index.js';
|
export { getGlobal, getSiteIntegrations, getSiteSettings, SITE_INTEGRATIONS_SLUG, SITE_SETTINGS_SLUG } from './modules/payload/index.js';
|
||||||
|
export { buildSecurityHeaders } from './modules/security/index.js';
|
||||||
|
export { buildCsp } from './modules/security/index.js';
|
||||||
export { buildHreflangAlternates, buildMetadata, composeTitle } from './modules/seo/index.js';
|
export { buildHreflangAlternates, buildMetadata, composeTitle } from './modules/seo/index.js';
|
||||||
export { buildAutoFillMetaHook, buildRobots, buildSitemapEntries, createMetadataGenerator, createPageMetadata, injectAutoFillMeta } from './modules/seo/index.js';
|
export { buildAutoFillMetaHook, buildRobots, buildSitemapEntries, createMetadataGenerator, createPageMetadata, injectAutoFillMeta } from './modules/seo/index.js';
|
||||||
|
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js';
|
||||||
|
export { buildBreadcrumbJsonLd, buildSiteNavigationJsonLd, buildWebSiteJsonLd } from './modules/seo/index.js';
|
||||||
|
// Local SEO structured data — LocalBusiness (map pack), Service (offering), FAQPage.
|
||||||
|
export { buildFaqJsonLd, buildLocalBusinessJsonLd, buildServiceJsonLd } from './modules/seo/index.js';
|
||||||
|
export { buildArticleJsonLd } from './modules/seo/index.js';
|
||||||
|
export { buildSitemapXml } from './modules/seo/index.js';
|
||||||
|
export { buildLlmsTxt } from './modules/seo/index.js';
|
||||||
export { buildSlugField, toSlug } from './modules/slug/index.js';
|
export { buildSlugField, toSlug } from './modules/slug/index.js';
|
||||||
|
export { buildR2Storage } from './modules/storage/index.js';
|
||||||
export { ipalKit } from './plugin.js';
|
export { ipalKit } from './plugin.js';
|
||||||
|
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
-3
@@ -1,3 +0,0 @@
|
|||||||
/** Requires at least the given role, for field-level access. */ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=access.d.js.map
|
|
||||||
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["access.d.ts"],"sourcesContent":["import type { Access, FieldAccess } from 'payload';\nimport type { Role } from './types.js';\n/**\n * Collection-level access (returns boolean | Where).\n * Use in collection `access.read/create/update/delete`.\n */\nexport declare const adminOnly: Access;\nexport declare const adminOrEditor: Access;\nexport declare const authenticated: Access;\n/** Requires at least the given role. */\nexport declare const requireRole: (minimum: Role) => Access;\n/** Admins see all; others are constrained to their own document. */\nexport declare const adminOrSelf: Access;\n/**\n * Field-level access (returns boolean only — no Where support).\n * Use in field `access.read/update`.\n */\nexport declare const adminOnlyField: FieldAccess;\nexport declare const adminOrEditorField: FieldAccess;\n/** Requires at least the given role, for field-level access. */\nexport declare const requireRoleField: (minimum: Role) => FieldAccess;\n"],"names":[],"mappings":"AAmBA,8DAA8D,GAC9D,WAAsE"}
|
|
||||||
Vendored
-7
@@ -1,7 +0,0 @@
|
|||||||
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, requireRole, requireRoleField } from './access.js';
|
|
||||||
export { injectRoles } from './injectRoles.js';
|
|
||||||
export { hasMinimumRole, isAdmin, isEditor } from './predicates.js';
|
|
||||||
export { buildRolesField } from './rolesField.js';
|
|
||||||
export { ROLE_HIERARCHY } from './types.js';
|
|
||||||
|
|
||||||
//# sourceMappingURL=index.d.js.map
|
|
||||||
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["index.d.ts"],"sourcesContent":["export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, requireRole, requireRoleField, } from './access.js';\nexport { injectRoles } from './injectRoles.js';\nexport { hasMinimumRole, isAdmin, isEditor } from './predicates.js';\nexport { buildRolesField } from './rolesField.js';\nexport type { AccessOption, Role } from './types.js';\nexport { ROLE_HIERARCHY } from './types.js';\n"],"names":["adminOnly","adminOnlyField","adminOrEditor","adminOrEditorField","adminOrSelf","authenticated","requireRole","requireRoleField","injectRoles","hasMinimumRole","isAdmin","isEditor","buildRolesField","ROLE_HIERARCHY"],"mappings":"AAAA,SAASA,SAAS,EAAEC,cAAc,EAAEC,aAAa,EAAEC,kBAAkB,EAAEC,WAAW,EAAEC,aAAa,EAAEC,WAAW,EAAEC,gBAAgB,QAAS,cAAc;AACvJ,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,cAAc,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,kBAAkB;AACpE,SAASC,eAAe,QAAQ,kBAAkB;AAElD,SAASC,cAAc,QAAQ,aAAa"}
|
|
||||||
Vendored
-9
@@ -1,9 +0,0 @@
|
|||||||
/**
|
|
||||||
* Injects the fixed `roles` field into the client's auth collection.
|
|
||||||
*
|
|
||||||
* The plugin owns the role definition; the client owns the collection. This
|
|
||||||
* finds the collection by slug and appends the field. We control the whole
|
|
||||||
* stack, so no conflict handling is needed — the field is simply added.
|
|
||||||
*/ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=injectRoles.d.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["injectRoles.d.ts"],"sourcesContent":["import type { Config } from 'payload';\nimport type { AccessOption } from './types.js';\n/**\n * Injects the fixed `roles` field into the client's auth collection.\n *\n * The plugin owns the role definition; the client owns the collection. This\n * finds the collection by slug and appends the field. We control the whole\n * stack, so no conflict handling is needed — the field is simply added.\n */\nexport declare function injectRoles(config: Config, access: AccessOption): Config;\n"],"names":[],"mappings":"AAEA;;;;;;CAMC,GACD,WAAkF"}
|
|
||||||
Vendored
-3
@@ -1,3 +0,0 @@
|
|||||||
export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=predicates.d.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["predicates.d.ts"],"sourcesContent":["import type { Role } from './types.js';\n/**\n * The plugin can't know the client's generated User type, and Payload types\n * `req.user` loosely (UntypedUser | null). Predicates therefore accept an\n * unknown-ish user and read `roles` defensively — no assumptions about shape\n * beyond an optional roles array.\n */\ntype MaybeUser = {\n roles?: null | Role[];\n} | null | Record<string, unknown> | undefined;\n/**\n * True if the user holds at least the given role in the hierarchy.\n * admin satisfies 'editor' and 'user'; editor satisfies 'user'.\n */\nexport declare function hasMinimumRole(user: MaybeUser, minimum: Role): boolean;\n/** True if the user is an admin. */\nexport declare function isAdmin(user: MaybeUser): boolean;\n/** True if the user is an editor or higher (editor, admin). */\nexport declare function isEditor(user: MaybeUser): boolean;\nexport {};\n"],"names":[],"mappings":"AAmBA,WAAU"}
|
|
||||||
Vendored
-8
@@ -1,8 +0,0 @@
|
|||||||
/**
|
|
||||||
* Builds the fixed `roles` field the plugin injects into the auth collection.
|
|
||||||
*
|
|
||||||
* Saved to the JWT so role checks avoid a database lookup. Only admins can
|
|
||||||
* change roles, preventing privilege escalation by lower-privilege users.
|
|
||||||
*/ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=rolesField.d.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["rolesField.d.ts"],"sourcesContent":["import type { Field } from 'payload';\nimport type { Role } from './types.js';\n/**\n * Builds the fixed `roles` field the plugin injects into the auth collection.\n *\n * Saved to the JWT so role checks avoid a database lookup. Only admins can\n * change roles, preventing privilege escalation by lower-privilege users.\n */\nexport declare function buildRolesField(defaultRole?: Role): Field;\n"],"names":[],"mappings":"AAEA;;;;;CAKC,GACD,WAAmE"}
|
|
||||||
Vendored
-12
@@ -1,12 +0,0 @@
|
|||||||
/**
|
|
||||||
* Role hierarchy, lowest to highest privilege.
|
|
||||||
* A higher role satisfies any requirement met by a lower one.
|
|
||||||
*/ /**
|
|
||||||
* Access-control options.
|
|
||||||
*
|
|
||||||
* The plugin injects a fixed `roles` field into the client's auth collection
|
|
||||||
* — the collection itself belongs to the client (create-payload-app), the
|
|
||||||
* role definition belongs to the plugin.
|
|
||||||
*/ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=types.d.js.map
|
|
||||||
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["types.d.ts"],"sourcesContent":["/**\n * Role hierarchy, lowest to highest privilege.\n * A higher role satisfies any requirement met by a lower one.\n */\nexport declare const ROLE_HIERARCHY: readonly [\"user\", \"editor\", \"admin\"];\nexport type Role = (typeof ROLE_HIERARCHY)[number];\n/**\n * Access-control options.\n *\n * The plugin injects a fixed `roles` field into the client's auth collection\n * — the collection itself belongs to the client (create-payload-app), the\n * role definition belongs to the plugin.\n */\nexport type AccessOption = {\n /** Slug of the client's auth collection, e.g. 'users'. */\n authCollection: string;\n /** Role assigned to new users. Defaults to 'user'. */\n defaultRole?: Role;\n};\n"],"names":[],"mappings":"AAAA;;;CAGC,GAGD;;;;;;CAMC,GACD,WAKE"}
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import { type A11yState } from './state.js';
|
||||||
|
type A11yContextValue = {
|
||||||
|
reset: () => void;
|
||||||
|
set: <K extends keyof A11yState>(key: K, value: A11yState[K]) => void;
|
||||||
|
state: A11yState;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Provides accessibility preferences, persists them in a cookie, and applies them
|
||||||
|
* as data-attributes on <html> so the project's CSS can react. Like
|
||||||
|
* ConsentProvider for cookies — wrap the app once; the widget/button consume it.
|
||||||
|
*
|
||||||
|
* The plugin ships NO styles: it only sets attributes (data-a11y-*). The project
|
||||||
|
* writes CSS for those it supports (see docs/accessibility.md). This keeps the
|
||||||
|
* design in the project's hands.
|
||||||
|
*
|
||||||
|
* // layout.tsx
|
||||||
|
* import { AccessibilityProvider } from '@intecion/ipal-kit/client'
|
||||||
|
* <AccessibilityProvider>{children}</AccessibilityProvider>
|
||||||
|
*
|
||||||
|
* To avoid a flash, the project can read the a11y-prefs cookie server-side and
|
||||||
|
* set the attributes on <html> during SSR (see docs). This provider re-applies
|
||||||
|
* on the client and keeps them in sync.
|
||||||
|
*/
|
||||||
|
export declare function AccessibilityProvider({ children }: {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}): import("react/jsx-runtime").JSX.Element;
|
||||||
|
/** Access accessibility preferences + setters. Use inside AccessibilityProvider. */
|
||||||
|
export declare function useAccessibility(): A11yContextValue;
|
||||||
|
export {};
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
'use client';
|
||||||
|
import { jsx as _jsx } from "react/jsx-runtime";
|
||||||
|
import { createContext, use, useCallback, useEffect, useState } from 'react';
|
||||||
|
import { A11Y_COOKIE, A11Y_COOKIE_MAX_AGE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './state.js';
|
||||||
|
const A11yContext = /*#__PURE__*/ createContext(null);
|
||||||
|
function readCookie(name) {
|
||||||
|
if (typeof document === 'undefined') {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const match = document.cookie.match(new RegExp(`(?:^|; )${name}=([^;]*)`));
|
||||||
|
return match ? decodeURIComponent(match[1]) : undefined;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Provides accessibility preferences, persists them in a cookie, and applies them
|
||||||
|
* as data-attributes on <html> so the project's CSS can react. Like
|
||||||
|
* ConsentProvider for cookies — wrap the app once; the widget/button consume it.
|
||||||
|
*
|
||||||
|
* The plugin ships NO styles: it only sets attributes (data-a11y-*). The project
|
||||||
|
* writes CSS for those it supports (see docs/accessibility.md). This keeps the
|
||||||
|
* design in the project's hands.
|
||||||
|
*
|
||||||
|
* // layout.tsx
|
||||||
|
* import { AccessibilityProvider } from '@intecion/ipal-kit/client'
|
||||||
|
* <AccessibilityProvider>{children}</AccessibilityProvider>
|
||||||
|
*
|
||||||
|
* To avoid a flash, the project can read the a11y-prefs cookie server-side and
|
||||||
|
* set the attributes on <html> during SSR (see docs). This provider re-applies
|
||||||
|
* on the client and keeps them in sync.
|
||||||
|
*/ export function AccessibilityProvider({ children }) {
|
||||||
|
const [state, setState] = useState(A11Y_DEFAULT);
|
||||||
|
// Hydrate from cookie on mount.
|
||||||
|
useEffect(()=>{
|
||||||
|
setState(parseA11y(readCookie(A11Y_COOKIE)));
|
||||||
|
}, []);
|
||||||
|
// Apply attributes to <html> whenever state changes.
|
||||||
|
useEffect(()=>{
|
||||||
|
const el = document.documentElement;
|
||||||
|
const attrs = a11yAttributes(state);
|
||||||
|
for (const [attr, value] of Object.entries(attrs)){
|
||||||
|
if (value === null) {
|
||||||
|
el.removeAttribute(attr);
|
||||||
|
} else {
|
||||||
|
el.setAttribute(attr, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [
|
||||||
|
state
|
||||||
|
]);
|
||||||
|
const persist = useCallback((next)=>{
|
||||||
|
document.cookie = `${A11Y_COOKIE}=${encodeURIComponent(serializeA11y(next))}; path=/; max-age=${A11Y_COOKIE_MAX_AGE}; samesite=lax`;
|
||||||
|
}, []);
|
||||||
|
const set = useCallback((key, value)=>{
|
||||||
|
setState((prev)=>{
|
||||||
|
const next = {
|
||||||
|
...prev,
|
||||||
|
[key]: value
|
||||||
|
};
|
||||||
|
persist(next);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
}, [
|
||||||
|
persist
|
||||||
|
]);
|
||||||
|
const reset = useCallback(()=>{
|
||||||
|
setState(A11Y_DEFAULT);
|
||||||
|
persist(A11Y_DEFAULT);
|
||||||
|
}, [
|
||||||
|
persist
|
||||||
|
]);
|
||||||
|
return /*#__PURE__*/ _jsx(A11yContext, {
|
||||||
|
value: {
|
||||||
|
reset,
|
||||||
|
set,
|
||||||
|
state
|
||||||
|
},
|
||||||
|
children: children
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** Access accessibility preferences + setters. Use inside AccessibilityProvider. */ export function useAccessibility() {
|
||||||
|
const ctx = use(A11yContext);
|
||||||
|
if (!ctx) {
|
||||||
|
throw new Error('useAccessibility must be used within <AccessibilityProvider>');
|
||||||
|
}
|
||||||
|
return ctx;
|
||||||
|
}
|
||||||
|
|
||||||
|
//# sourceMappingURL=AccessibilityProvider.js.map
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,41 @@
|
|||||||
|
export type A11yTexts = {
|
||||||
|
bigCursor?: string;
|
||||||
|
close?: string;
|
||||||
|
contrast?: string;
|
||||||
|
contrastHigh?: string;
|
||||||
|
contrastInverted?: string;
|
||||||
|
grayscale?: string;
|
||||||
|
lineHeight?: string;
|
||||||
|
open?: string;
|
||||||
|
readableFont?: string;
|
||||||
|
reduceMotion?: string;
|
||||||
|
reset?: string;
|
||||||
|
textSize?: string;
|
||||||
|
title?: string;
|
||||||
|
underlineLinks?: string;
|
||||||
|
};
|
||||||
|
export type A11yClassNames = {
|
||||||
|
active?: string;
|
||||||
|
button?: string;
|
||||||
|
closeButton?: string;
|
||||||
|
control?: string;
|
||||||
|
label?: string;
|
||||||
|
panel?: string;
|
||||||
|
resetButton?: string;
|
||||||
|
row?: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Accessibility toolbar: a floating button that opens a panel of options (text
|
||||||
|
* size, line height, contrast, grayscale, underline links, readable font, reduce
|
||||||
|
* motion, big cursor). Choices persist in a cookie and apply as data-attributes
|
||||||
|
* on <html> (the project's CSS styles them).
|
||||||
|
*
|
||||||
|
* Unstyled by default — pass classNames to match the project's design (like
|
||||||
|
* CookieBanner). Wrap the app in <AccessibilityProvider> first.
|
||||||
|
*
|
||||||
|
* <AccessibilityWidget classNames={{ button: 'a11y-btn', panel: 'a11y-panel' }} />
|
||||||
|
*/
|
||||||
|
export declare function AccessibilityWidget({ classNames, texts, }: {
|
||||||
|
classNames?: A11yClassNames;
|
||||||
|
texts?: A11yTexts;
|
||||||
|
}): import("react/jsx-runtime").JSX.Element;
|
||||||
+188
@@ -0,0 +1,188 @@
|
|||||||
|
'use client';
|
||||||
|
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'
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Accessibility toolbar: a floating button that opens a panel of options (text
|
||||||
|
* size, line height, contrast, grayscale, underline links, readable font, reduce
|
||||||
|
* motion, big cursor). Choices persist in a cookie and apply as data-attributes
|
||||||
|
* on <html> (the project's CSS styles them).
|
||||||
|
*
|
||||||
|
* Unstyled by default — pass classNames to match the project's design (like
|
||||||
|
* CookieBanner). Wrap the app in <AccessibilityProvider> first.
|
||||||
|
*
|
||||||
|
* <AccessibilityWidget classNames={{ button: 'a11y-btn', panel: 'a11y-panel' }} />
|
||||||
|
*/ export function AccessibilityWidget({ classNames, texts }) {
|
||||||
|
const { reset, set, state } = useAccessibility();
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
const t = {
|
||||||
|
...DEFAULT_TEXTS,
|
||||||
|
...texts
|
||||||
|
};
|
||||||
|
const cn = classNames ?? {};
|
||||||
|
const toggle = (key)=>set(key, !state[key]);
|
||||||
|
const isActive = (on)=>on ? cn.active ?? '' : '';
|
||||||
|
return /*#__PURE__*/ _jsxs(_Fragment, {
|
||||||
|
children: [
|
||||||
|
/*#__PURE__*/ _jsx("button", {
|
||||||
|
"aria-expanded": open,
|
||||||
|
"aria-label": t.open,
|
||||||
|
className: cn.button,
|
||||||
|
onClick: ()=>setOpen((o)=>!o),
|
||||||
|
type: "button",
|
||||||
|
children: /*#__PURE__*/ _jsx("span", {
|
||||||
|
"aria-hidden": "true",
|
||||||
|
children: "♿"
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
open && /*#__PURE__*/ _jsxs("div", {
|
||||||
|
"aria-label": t.title,
|
||||||
|
className: cn.panel,
|
||||||
|
role: "dialog",
|
||||||
|
children: [
|
||||||
|
/*#__PURE__*/ _jsxs("div", {
|
||||||
|
className: cn.row,
|
||||||
|
children: [
|
||||||
|
/*#__PURE__*/ _jsx("span", {
|
||||||
|
className: cn.label,
|
||||||
|
children: t.textSize
|
||||||
|
}),
|
||||||
|
/*#__PURE__*/ _jsx("div", {
|
||||||
|
className: cn.control,
|
||||||
|
children: [
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3
|
||||||
|
].map((n)=>/*#__PURE__*/ _jsxs("button", {
|
||||||
|
className: isActive(state.textSize === n),
|
||||||
|
onClick: ()=>set('textSize', n),
|
||||||
|
type: "button",
|
||||||
|
children: [
|
||||||
|
"A",
|
||||||
|
n > 0 ? '+'.repeat(n) : ''
|
||||||
|
]
|
||||||
|
}, n))
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
/*#__PURE__*/ _jsxs("div", {
|
||||||
|
className: cn.row,
|
||||||
|
children: [
|
||||||
|
/*#__PURE__*/ _jsx("span", {
|
||||||
|
className: cn.label,
|
||||||
|
children: t.lineHeight
|
||||||
|
}),
|
||||||
|
/*#__PURE__*/ _jsx("div", {
|
||||||
|
className: cn.control,
|
||||||
|
children: [
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2
|
||||||
|
].map((n)=>/*#__PURE__*/ _jsx("button", {
|
||||||
|
className: isActive(state.lineHeight === n),
|
||||||
|
onClick: ()=>set('lineHeight', n),
|
||||||
|
type: "button",
|
||||||
|
children: n === 0 ? '—' : '≡'.repeat(n)
|
||||||
|
}, n))
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
/*#__PURE__*/ _jsxs("div", {
|
||||||
|
className: cn.row,
|
||||||
|
children: [
|
||||||
|
/*#__PURE__*/ _jsx("span", {
|
||||||
|
className: cn.label,
|
||||||
|
children: t.contrast
|
||||||
|
}),
|
||||||
|
/*#__PURE__*/ _jsxs("div", {
|
||||||
|
className: cn.control,
|
||||||
|
children: [
|
||||||
|
/*#__PURE__*/ _jsx("button", {
|
||||||
|
className: isActive(state.contrast === 'high'),
|
||||||
|
onClick: ()=>set('contrast', state.contrast === 'high' ? 'default' : 'high'),
|
||||||
|
type: "button",
|
||||||
|
children: t.contrastHigh
|
||||||
|
}),
|
||||||
|
/*#__PURE__*/ _jsx("button", {
|
||||||
|
className: isActive(state.contrast === 'inverted'),
|
||||||
|
onClick: ()=>set('contrast', state.contrast === 'inverted' ? 'default' : 'inverted'),
|
||||||
|
type: "button",
|
||||||
|
children: t.contrastInverted
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
[
|
||||||
|
[
|
||||||
|
'grayscale',
|
||||||
|
t.grayscale
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'underlineLinks',
|
||||||
|
t.underlineLinks
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'readableFont',
|
||||||
|
t.readableFont
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'reduceMotion',
|
||||||
|
t.reduceMotion
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'bigCursor',
|
||||||
|
t.bigCursor
|
||||||
|
]
|
||||||
|
].map(([key, label])=>/*#__PURE__*/ _jsxs("div", {
|
||||||
|
className: cn.row,
|
||||||
|
children: [
|
||||||
|
/*#__PURE__*/ _jsx("span", {
|
||||||
|
className: cn.label,
|
||||||
|
children: label
|
||||||
|
}),
|
||||||
|
/*#__PURE__*/ _jsx("button", {
|
||||||
|
"aria-pressed": Boolean(state[key]),
|
||||||
|
className: `${cn.control ?? ''} ${isActive(Boolean(state[key]))}`,
|
||||||
|
onClick: ()=>toggle(key),
|
||||||
|
type: "button",
|
||||||
|
children: state[key] ? 'ON' : 'OFF'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}, key)),
|
||||||
|
/*#__PURE__*/ _jsx("button", {
|
||||||
|
className: cn.resetButton,
|
||||||
|
onClick: reset,
|
||||||
|
type: "button",
|
||||||
|
children: t.reset
|
||||||
|
}),
|
||||||
|
/*#__PURE__*/ _jsx("button", {
|
||||||
|
className: cn.closeButton,
|
||||||
|
onClick: ()=>setOpen(false),
|
||||||
|
type: "button",
|
||||||
|
children: t.close
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//# sourceMappingURL=AccessibilityWidget.js.map
|
||||||
File diff suppressed because one or more lines are too long
+5
@@ -0,0 +1,5 @@
|
|||||||
|
export { AccessibilityProvider, useAccessibility } from './AccessibilityProvider.js';
|
||||||
|
export { AccessibilityWidget } from './AccessibilityWidget.js';
|
||||||
|
export type { A11yClassNames, A11yTexts } from './AccessibilityWidget.js';
|
||||||
|
export type { A11yState } from './state.js';
|
||||||
|
export { A11Y_COOKIE, a11yAttributes, parseA11y } from './state.js';
|
||||||
Vendored
+6
@@ -0,0 +1,6 @@
|
|||||||
|
'use client';
|
||||||
|
export { AccessibilityProvider, useAccessibility } from './AccessibilityProvider.js';
|
||||||
|
export { AccessibilityWidget } from './AccessibilityWidget.js';
|
||||||
|
export { A11Y_COOKIE, a11yAttributes, parseA11y } from './state.js';
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"sources":["../../../src/modules/accessibility/client.ts"],"sourcesContent":["'use client'\nexport { AccessibilityProvider, useAccessibility } from './AccessibilityProvider.js'\nexport { AccessibilityWidget } from './AccessibilityWidget.js'\nexport type { A11yClassNames, A11yTexts } from './AccessibilityWidget.js'\nexport type { A11yState } from './state.js'\nexport { A11Y_COOKIE, a11yAttributes, parseA11y } from './state.js'\n"],"names":["AccessibilityProvider","useAccessibility","AccessibilityWidget","A11Y_COOKIE","a11yAttributes","parseA11y"],"mappings":"AAAA;AACA,SAASA,qBAAqB,EAAEC,gBAAgB,QAAQ,6BAA4B;AACpF,SAASC,mBAAmB,QAAQ,2BAA0B;AAG9D,SAASC,WAAW,EAAEC,cAAc,EAAEC,SAAS,QAAQ,aAAY"}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
export { AccessibilityProvider, useAccessibility } from './AccessibilityProvider.js';
|
||||||
|
export { AccessibilityWidget } from './AccessibilityWidget.js';
|
||||||
|
export type { A11yClassNames, A11yTexts } from './AccessibilityWidget.js';
|
||||||
|
export { A11Y_COOKIE, A11Y_COOKIE_MAX_AGE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y, } from './state.js';
|
||||||
|
export type { A11yState } from './state.js';
|
||||||
Vendored
+5
@@ -0,0 +1,5 @@
|
|||||||
|
export { AccessibilityProvider, useAccessibility } from './AccessibilityProvider.js';
|
||||||
|
export { AccessibilityWidget } from './AccessibilityWidget.js';
|
||||||
|
export { A11Y_COOKIE, A11Y_COOKIE_MAX_AGE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './state.js';
|
||||||
|
|
||||||
|
//# sourceMappingURL=index.js.map
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"sources":["../../../src/modules/accessibility/index.ts"],"sourcesContent":["export { AccessibilityProvider, useAccessibility } from './AccessibilityProvider.js'\nexport { AccessibilityWidget } from './AccessibilityWidget.js'\nexport type { A11yClassNames, A11yTexts } from './AccessibilityWidget.js'\nexport {\n A11Y_COOKIE,\n A11Y_COOKIE_MAX_AGE,\n A11Y_DEFAULT,\n a11yAttributes,\n parseA11y,\n serializeA11y,\n} from './state.js'\nexport type { A11yState } from './state.js'\n"],"names":["AccessibilityProvider","useAccessibility","AccessibilityWidget","A11Y_COOKIE","A11Y_COOKIE_MAX_AGE","A11Y_DEFAULT","a11yAttributes","parseA11y","serializeA11y"],"mappings":"AAAA,SAASA,qBAAqB,EAAEC,gBAAgB,QAAQ,6BAA4B;AACpF,SAASC,mBAAmB,QAAQ,2BAA0B;AAE9D,SACEC,WAAW,EACXC,mBAAmB,EACnBC,YAAY,EACZC,cAAc,EACdC,SAAS,EACTC,aAAa,QACR,aAAY"}
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
/**
|
||||||
|
* Accessibility preferences state. Each option maps to a data-attribute on
|
||||||
|
* <html> (e.g. data-a11y-contrast="high"); the PROJECT's CSS reacts to those
|
||||||
|
* attributes. The plugin sets the attributes and persists the choice — it does
|
||||||
|
* NOT ship styles, so it never fights the project's design.
|
||||||
|
*/
|
||||||
|
export type A11yState = {
|
||||||
|
/** Larger cursor. */
|
||||||
|
bigCursor: boolean;
|
||||||
|
/** 'default' | 'high' (high contrast) | 'inverted' (dark-on-light flip). */
|
||||||
|
contrast: 'default' | 'high' | 'inverted';
|
||||||
|
/** Grayscale filter on the whole page. */
|
||||||
|
grayscale: boolean;
|
||||||
|
/** Line spacing: 0 = default, 1..2 = looser. */
|
||||||
|
lineHeight: 0 | 1 | 2;
|
||||||
|
/** Readable font (project maps this to a dyslexia-friendly / simple font). */
|
||||||
|
readableFont: boolean;
|
||||||
|
/** Stop animations / transitions (prefers-reduced-motion equivalent). */
|
||||||
|
reduceMotion: boolean;
|
||||||
|
/** Text size step: 0 = default, 1..3 = larger. */
|
||||||
|
textSize: 0 | 1 | 2 | 3;
|
||||||
|
/** Underline all links (WCAG: don't rely on color alone). */
|
||||||
|
underlineLinks: boolean;
|
||||||
|
};
|
||||||
|
export declare const A11Y_DEFAULT: A11yState;
|
||||||
|
export declare const A11Y_COOKIE = "a11y-prefs";
|
||||||
|
export declare const A11Y_COOKIE_MAX_AGE: number;
|
||||||
|
/** Serialize for the cookie (compact). */
|
||||||
|
export declare function serializeA11y(state: A11yState): string;
|
||||||
|
/** Parse from the cookie; falls back to defaults on any bad value. */
|
||||||
|
export declare function parseA11y(raw: null | string | undefined): A11yState;
|
||||||
|
/**
|
||||||
|
* Maps state → data-attributes to set on <html>. Returns { attr: value|null };
|
||||||
|
* null means remove the attribute (option is at default). The project's CSS
|
||||||
|
* targets these, e.g. `[data-a11y-contrast="high"] { … }`.
|
||||||
|
*/
|
||||||
|
export declare function a11yAttributes(state: A11yState): Record<string, null | string>;
|
||||||
Vendored
+53
@@ -0,0 +1,53 @@
|
|||||||
|
/**
|
||||||
|
* Accessibility preferences state. Each option maps to a data-attribute on
|
||||||
|
* <html> (e.g. data-a11y-contrast="high"); the PROJECT's CSS reacts to those
|
||||||
|
* attributes. The plugin sets the attributes and persists the choice — it does
|
||||||
|
* NOT ship styles, so it never fights the project's design.
|
||||||
|
*/ export const A11Y_DEFAULT = {
|
||||||
|
bigCursor: false,
|
||||||
|
contrast: 'default',
|
||||||
|
grayscale: false,
|
||||||
|
lineHeight: 0,
|
||||||
|
readableFont: false,
|
||||||
|
reduceMotion: false,
|
||||||
|
textSize: 0,
|
||||||
|
underlineLinks: false
|
||||||
|
};
|
||||||
|
export const A11Y_COOKIE = 'a11y-prefs';
|
||||||
|
export const A11Y_COOKIE_MAX_AGE = 60 * 60 * 24 * 365 // 1 year
|
||||||
|
;
|
||||||
|
/** Serialize for the cookie (compact). */ export function serializeA11y(state) {
|
||||||
|
return JSON.stringify(state);
|
||||||
|
}
|
||||||
|
/** Parse from the cookie; falls back to defaults on any bad value. */ export function parseA11y(raw) {
|
||||||
|
if (!raw) {
|
||||||
|
return A11Y_DEFAULT;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const parsed = JSON.parse(raw);
|
||||||
|
return {
|
||||||
|
...A11Y_DEFAULT,
|
||||||
|
...parsed
|
||||||
|
};
|
||||||
|
} catch {
|
||||||
|
return A11Y_DEFAULT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Maps state → data-attributes to set on <html>. Returns { attr: value|null };
|
||||||
|
* null means remove the attribute (option is at default). The project's CSS
|
||||||
|
* targets these, e.g. `[data-a11y-contrast="high"] { … }`.
|
||||||
|
*/ export function a11yAttributes(state) {
|
||||||
|
return {
|
||||||
|
'data-a11y-contrast': state.contrast !== 'default' ? state.contrast : null,
|
||||||
|
'data-a11y-cursor': state.bigCursor ? 'big' : null,
|
||||||
|
'data-a11y-font': state.readableFont ? 'readable' : null,
|
||||||
|
'data-a11y-grayscale': state.grayscale ? 'on' : null,
|
||||||
|
'data-a11y-line': state.lineHeight > 0 ? String(state.lineHeight) : null,
|
||||||
|
'data-a11y-motion': state.reduceMotion ? 'reduce' : null,
|
||||||
|
'data-a11y-text': state.textSize > 0 ? String(state.textSize) : null,
|
||||||
|
'data-a11y-underline': state.underlineLinks ? 'on' : null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
//# sourceMappingURL=state.js.map
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"sources":["../../../src/modules/accessibility/state.ts"],"sourcesContent":["/**\n * Accessibility preferences state. Each option maps to a data-attribute on\n * <html> (e.g. data-a11y-contrast=\"high\"); the PROJECT's CSS reacts to those\n * attributes. The plugin sets the attributes and persists the choice — it does\n * NOT ship styles, so it never fights the project's design.\n */\nexport type A11yState = {\n /** Larger cursor. */\n bigCursor: boolean\n /** 'default' | 'high' (high contrast) | 'inverted' (dark-on-light flip). */\n contrast: 'default' | 'high' | 'inverted'\n /** Grayscale filter on the whole page. */\n grayscale: boolean\n /** Line spacing: 0 = default, 1..2 = looser. */\n lineHeight: 0 | 1 | 2\n /** Readable font (project maps this to a dyslexia-friendly / simple font). */\n readableFont: boolean\n /** Stop animations / transitions (prefers-reduced-motion equivalent). */\n reduceMotion: boolean\n /** Text size step: 0 = default, 1..3 = larger. */\n textSize: 0 | 1 | 2 | 3\n /** Underline all links (WCAG: don't rely on color alone). */\n underlineLinks: boolean\n}\n\nexport const A11Y_DEFAULT: A11yState = {\n bigCursor: false,\n contrast: 'default',\n grayscale: false,\n lineHeight: 0,\n readableFont: false,\n reduceMotion: false,\n textSize: 0,\n underlineLinks: false,\n}\n\nexport const A11Y_COOKIE = 'a11y-prefs'\nexport const A11Y_COOKIE_MAX_AGE = 60 * 60 * 24 * 365 // 1 year\n\n/** Serialize for the cookie (compact). */\nexport function serializeA11y(state: A11yState): string {\n return JSON.stringify(state)\n}\n\n/** Parse from the cookie; falls back to defaults on any bad value. */\nexport function parseA11y(raw: null | string | undefined): A11yState {\n if (!raw) {return A11Y_DEFAULT}\n try {\n const parsed = JSON.parse(raw) as Partial<A11yState>\n return { ...A11Y_DEFAULT, ...parsed }\n } catch {\n return A11Y_DEFAULT\n }\n}\n\n/**\n * Maps state → data-attributes to set on <html>. Returns { attr: value|null };\n * null means remove the attribute (option is at default). The project's CSS\n * targets these, e.g. `[data-a11y-contrast=\"high\"] { … }`.\n */\nexport function a11yAttributes(state: A11yState): Record<string, null | string> {\n return {\n 'data-a11y-contrast': state.contrast !== 'default' ? state.contrast : null,\n 'data-a11y-cursor': state.bigCursor ? 'big' : null,\n 'data-a11y-font': state.readableFont ? 'readable' : null,\n 'data-a11y-grayscale': state.grayscale ? 'on' : null,\n 'data-a11y-line': state.lineHeight > 0 ? String(state.lineHeight) : null,\n 'data-a11y-motion': state.reduceMotion ? 'reduce' : null,\n 'data-a11y-text': state.textSize > 0 ? String(state.textSize) : null,\n 'data-a11y-underline': state.underlineLinks ? 'on' : null,\n }\n}\n"],"names":["A11Y_DEFAULT","bigCursor","contrast","grayscale","lineHeight","readableFont","reduceMotion","textSize","underlineLinks","A11Y_COOKIE","A11Y_COOKIE_MAX_AGE","serializeA11y","state","JSON","stringify","parseA11y","raw","parsed","parse","a11yAttributes","String"],"mappings":"AAAA;;;;;CAKC,GAoBD,OAAO,MAAMA,eAA0B;IACrCC,WAAW;IACXC,UAAU;IACVC,WAAW;IACXC,YAAY;IACZC,cAAc;IACdC,cAAc;IACdC,UAAU;IACVC,gBAAgB;AAClB,EAAC;AAED,OAAO,MAAMC,cAAc,aAAY;AACvC,OAAO,MAAMC,sBAAsB,KAAK,KAAK,KAAK,IAAI,SAAS;CAAV;AAErD,wCAAwC,GACxC,OAAO,SAASC,cAAcC,KAAgB;IAC5C,OAAOC,KAAKC,SAAS,CAACF;AACxB;AAEA,oEAAoE,GACpE,OAAO,SAASG,UAAUC,GAA8B;IACtD,IAAI,CAACA,KAAK;QAAC,OAAOhB;IAAY;IAC9B,IAAI;QACF,MAAMiB,SAASJ,KAAKK,KAAK,CAACF;QAC1B,OAAO;YAAE,GAAGhB,YAAY;YAAE,GAAGiB,MAAM;QAAC;IACtC,EAAE,OAAM;QACN,OAAOjB;IACT;AACF;AAEA;;;;CAIC,GACD,OAAO,SAASmB,eAAeP,KAAgB;IAC7C,OAAO;QACL,sBAAsBA,MAAMV,QAAQ,KAAK,YAAYU,MAAMV,QAAQ,GAAG;QACtE,oBAAoBU,MAAMX,SAAS,GAAG,QAAQ;QAC9C,kBAAkBW,MAAMP,YAAY,GAAG,aAAa;QACpD,uBAAuBO,MAAMT,SAAS,GAAG,OAAO;QAChD,kBAAkBS,MAAMR,UAAU,GAAG,IAAIgB,OAAOR,MAAMR,UAAU,IAAI;QACpE,oBAAoBQ,MAAMN,YAAY,GAAG,WAAW;QACpD,kBAAkBM,MAAML,QAAQ,GAAG,IAAIa,OAAOR,MAAML,QAAQ,IAAI;QAChE,uBAAuBK,MAAMJ,cAAc,GAAG,OAAO;IACvD;AACF"}
|
||||||
-14
@@ -1,14 +0,0 @@
|
|||||||
/**
|
|
||||||
* Loads Google Analytics — GTM if a container ID is set, otherwise GA4 gtag.
|
|
||||||
*
|
|
||||||
* 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).
|
|
||||||
*
|
|
||||||
* Renders nothing — it only injects the scripts. Mount once, high in the tree
|
|
||||||
* (e.g. root layout), inside ConsentProvider.
|
|
||||||
*/ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=Analytics.d.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["Analytics.d.ts"],"sourcesContent":["import type { AnalyticsConfig } from './types.js';\ndeclare global {\n interface Window {\n dataLayer?: unknown[];\n }\n}\n/**\n * Loads Google Analytics — GTM if a container ID is set, otherwise GA4 gtag.\n *\n * Consent Mode is initialised to the visitor's stored consent BEFORE the tag\n * loads (via setDefaultConsent from the consent module), so tags respect the\n * choice from the first hit; useConsent sends an update the moment the visitor\n * decides. IDs are public and come from SiteIntegrations, passed in as props\n * (the client project reads them server-side).\n *\n * Renders nothing — it only injects the scripts. Mount once, high in the tree\n * (e.g. root layout), inside ConsentProvider.\n */\nexport declare function Analytics({ ga4MeasurementId, gtmContainerId }: AnalyticsConfig): null;\n"],"names":[],"mappings":"AAMA;;;;;;;;;;;CAWC,GACD,WAA+F"}
|
|
||||||
Vendored
-3
@@ -1,3 +0,0 @@
|
|||||||
export { Analytics } from './Analytics.js';
|
|
||||||
|
|
||||||
//# sourceMappingURL=client.d.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["client.d.ts"],"sourcesContent":["export { Analytics } from './Analytics.js';\n"],"names":["Analytics"],"mappings":"AAAA,SAASA,SAAS,QAAQ,iBAAiB"}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
/**
|
|
||||||
* Reads the public analytics IDs from SiteIntegrations, server-side.
|
|
||||||
*
|
|
||||||
* Returns only the two public IDs (GA4 / GTM) — safe to pass to the client
|
|
||||||
* <Analytics> component. Does NOT expose any secret from SiteIntegrations.
|
|
||||||
*/ export { };
|
|
||||||
|
|
||||||
//# sourceMappingURL=getAnalyticsConfig.d.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["getAnalyticsConfig.d.ts"],"sourcesContent":["import type { BasePayload } from 'payload';\nimport type { AnalyticsConfig } from './types.js';\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 declare function getAnalyticsConfig(payload: BasePayload): Promise<AnalyticsConfig>;\n"],"names":[],"mappings":"AAEA;;;;;CAKC,GACD,WAA2F"}
|
|
||||||
Vendored
-3
@@ -1,3 +0,0 @@
|
|||||||
export { getAnalyticsConfig } from './getAnalyticsConfig.js';
|
|
||||||
|
|
||||||
//# sourceMappingURL=index.d.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["index.d.ts"],"sourcesContent":["export type { AnalyticsConfig } from './types.js';\nexport { getAnalyticsConfig } from './getAnalyticsConfig.js';\n"],"names":["getAnalyticsConfig"],"mappings":"AACA,SAASA,kBAAkB,QAAQ,0BAA0B"}
|
|
||||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
export type { AnalyticsConfig } from './types.js';
|
|
||||||
export { getAnalyticsConfig } from './getAnalyticsConfig.js';
|
export { getAnalyticsConfig } from './getAnalyticsConfig.js';
|
||||||
|
export type { AnalyticsConfig } from './types.js';
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user