CookieBanner: order, settings="modal", controls="switch", settingsActions, icon and a class slot for every element. Cookie Settings gains eyebrow, title, settingsDescription, alwaysActiveLabel and buttons.close. MaskedField, TestEmailButton and IntegrationStatusBanner import @payloadcms/ui and moved from /client to /admin; with sideEffects in package.json the site bundle no longer ships ~235 KB gz of admin code. A test walks the /client import graph to keep it that way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import type { Field } from 'payload'
|
|
|
|
import { buildIntegrationStatusBanner, buildIntegrationStatusField } from '../../../modules/integrations/status.js'
|
|
|
|
/**
|
|
* 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 const turnstileFields: Field[] = [
|
|
// Status written by the server when it verifies a form (checkTurnstile) — banner on this tab.
|
|
buildIntegrationStatusBanner('turnstileStatus', 'Turnstile'),
|
|
{
|
|
name: 'turnstileSiteKey',
|
|
type: 'text',
|
|
admin: {
|
|
description: 'Public site key rendered in the Turnstile widget.',
|
|
},
|
|
},
|
|
{
|
|
name: 'turnstileSecretKey',
|
|
type: 'text',
|
|
admin: {
|
|
description: 'Secret key used for server-side verification.',
|
|
// Masked in the UI (••••) — stored plaintext, readable for verification.
|
|
components: {
|
|
Field: '@intecion/ipal-kit/admin#MaskedField',
|
|
},
|
|
},
|
|
},
|
|
buildIntegrationStatusField('turnstileStatus'),
|
|
]
|