1.18.0 performance items: reference 404 placeholder and heading font without preload, lazy form and Turnstile code (eager entry /client/eager), Turnstile space kept, background video paused for reduced motion, card hover on opacity, metadata stripped on upload, MongoDB TTL indexes for the consent log and statistics, unused-media notice, version limit for the plugin's entities

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-12-01 15:38:38 +01:00
co-authored by Claude Opus 5.5
parent 076b3ef707
commit d628839235
47 changed files with 2546 additions and 78 deletions
+15 -4
View File
@@ -1,16 +1,16 @@
import type { SerializedEditorState } from '@payloadcms/richtext-lexical/lexical'
import type { JSXConvertersFunction } from '@payloadcms/richtext-lexical/react'
import type { ReactNode } from 'react'
import type { ComponentType, ReactNode } from 'react'
import type { ResolveLinkHrefOptions } from '../links/resolveLinkHref.js'
import type { TurnstileTheme } from '../turnstile/Turnstile.js'
import type { BuilderFormClassNames } from './BuilderForm.js'
import type { BuilderFormClassNames, BuilderFormProps } from './BuilderForm.js'
import type { BuilderField, BuilderFormDoc, BuilderFormTexts } from './builderTypes.js'
import type { SubmitActionResult } from './createSubmitAction.js'
import { resolveLinkHref, safeHref } from '../links/resolveLinkHref.js'
import { RenderRichText } from '../richtext/RenderRichText.js'
import { BuilderForm } from './BuilderForm.js'
import { LazyBuilderForm } from './LazyBuilderForm.js'
/** The action from createSubmitAction — `sendForm(formId, locale, values, token?)`. */
export type SendFormAction = (
@@ -24,6 +24,11 @@ export type RenderFormProps = {
/** The project's `sendForm` server action (createSubmitAction). */
action: SendFormAction
classNames?: BuilderFormClassNames
/**
* The client form component. Default: the lazy one (1.18.0) — its code loads only on pages with a form, the HTML
* is complete either way. `Form={BuilderForm}` from `@intecion/ipal-kit/client/eager` = in every page's bundle.
*/
Form?: ComponentType<BuilderFormProps>
/** Rich text styling for message blocks and the confirmation (same as RenderRichText). */
converters?: JSXConvertersFunction
/** The `form` relationship of the block, populated (page query depth ≥ 1). An id or null renders nothing. */
@@ -39,6 +44,8 @@ export type RenderFormProps = {
/** Notifications → form texts in this locale (getNotificationTexts(...).form). */
texts: BuilderFormTexts
/** Widget theme. Default 'page' — follows the site's light/dark theme. */
/** Space kept for the Turnstile widget before it is drawn (default 73 px; 0 for an invisible widget). */
turnstileReserveHeight?: number
turnstileTheme?: TurnstileTheme
/** Values of fields the page already knows, by field name — read-only for the visitor, sent with the form. */
values?: Record<string, string>
@@ -143,22 +150,26 @@ export function RenderForm({
classNames,
converters,
form,
Form = LazyBuilderForm,
linkOptions,
locale,
requiredMark,
richTextClassName,
texts,
turnstileReserveHeight,
turnstileTheme,
values,
}: RenderFormProps) {
const prepared = prepareBuilderForm({ action, converters, form, linkOptions, locale, richTextClassName })
if (!prepared) {return null}
// the form's code is fetched only on pages that have a form (the HTML stays complete): LazyBuilderForm.tsx
return (
<BuilderForm
<Form
{...prepared}
classNames={classNames}
requiredMark={requiredMark}
texts={texts}
turnstileReserveHeight={turnstileReserveHeight}
turnstileTheme={turnstileTheme}
values={values}
/>