Every form block (built-in, Checkbox group, Step, message) gets a showWhen group: visible only when another field has one of the given values. A hidden Step drops out with its fields; browser and server share visibleFields, so a hidden field is neither required nor stored. GDPR consent is always enforced. Co-Authored-By: Claude Opus 5.5 <[email protected]>
40 lines
2.1 KiB
TypeScript
40 lines
2.1 KiB
TypeScript
// Panel field types: step-by-step forms + multiple choice (enabled by default).
|
|
export { checkboxGroupBlock, stepBlock } from './builderBlocks.js'
|
|
// Pure panel-form logic (steps, values, validation) — the engine of useBuilderForm.
|
|
export { initialBuilderValues, inputFields, splitSteps, stepOfField, validateBuilderFields, visibleFields } from './builderLogic.js'
|
|
export type { BuilderField, BuilderFormDoc, BuilderFormTexts, BuilderStep, FieldCondition } from './builderTypes.js'
|
|
export { formAnalyticsOnSuccess } from './formAnalytics.js'
|
|
export type { FormAnalyticsConfig } from './formAnalytics.js'
|
|
// Panel-managed form analytics: fields (config-time) + onSuccess helper (client).
|
|
export { buildFormAnalyticsFields } from './formAnalyticsFields.js'
|
|
// buildFormsPlugin is config-time (safe anywhere). submitForm is server-only
|
|
// (Turnstile secret) — never import it from a client component.
|
|
export { buildFormsPlugin } from './formsPluginConfig.js'
|
|
// Honeypot anti-spam (pure — client renders the input, server checks it).
|
|
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './honeypot.js'
|
|
export { checkRateLimit } from './rateLimit.js'
|
|
export type { RateLimitArgs } from './rateLimit.js'
|
|
export { submitForm } from './submitForm.js'
|
|
export type { SubmitFormArgs, SubmitFormResult } from './submitForm.js'
|
|
export type { FormsCollectionOverrides, FormsFieldsOverride, FormsOption } from './types.js'
|
|
export { useContactForm } from './useContactForm.js'
|
|
export type { ContactFormErrors, ContactFormValues, SubmitAction } from './useContactForm.js'
|
|
// Generic form engine (any field set) + the standard contact-form preset.
|
|
export { useForm } from './useForm.js'
|
|
export type { FormErrors, FormSubmitAction, Validator } from './useForm.js'
|
|
export { validateSubmission } from './validateSubmission.js'
|
|
export type { FormValidationResult } from './validateSubmission.js'
|
|
// Composable validation rules (pure — safe on server or client).
|
|
export {
|
|
buildValidator,
|
|
checked,
|
|
custom,
|
|
email,
|
|
isEmail,
|
|
maxLength,
|
|
minLength,
|
|
pattern,
|
|
required,
|
|
} from './validators.js'
|
|
export type { Rule } from './validators.js'
|