feat: client-text and client-checkbox field types — signer fills text/checks boxes on signing page

This commit is contained in:
Chandler Copeland
2026-04-06 11:35:30 -06:00
parent 116fa2bdfb
commit 6013dfe89f
6 changed files with 212 additions and 126 deletions

View File

@@ -38,6 +38,8 @@ const FIELD_HEIGHTS: Record<SignatureFieldType, number> = {
'date': 12,
'text': 12,
'checkbox': 14,
'client-text': 12,
'client-checkbox': 14,
};
// Width clamping — use the exact measured blank width but stay within these bounds
@@ -49,6 +51,8 @@ const SIZE_LIMITS: Record<SignatureFieldType, { minW: number; maxW: number }> =
'date': { minW: 50, maxW: 130 },
'text': { minW: 30, maxW: 280 },
'checkbox': { minW: 14, maxW: 20 },
'client-text': { minW: 30, maxW: 280 },
'client-checkbox': { minW: 14, maxW: 20 },
};
/**

View File

@@ -4,11 +4,13 @@ import { relations } from "drizzle-orm";
export type SignatureFieldType =
| 'client-signature'
| 'initials'
| 'text'
| 'checkbox'
| 'date'
| 'text' // agent fills at prepare time
| 'checkbox' // agent fills at prepare time
| 'date' // auto-stamped with signing date
| 'agent-signature'
| 'agent-initials';
| 'agent-initials'
| 'client-text' // signer types a value on the signing page
| 'client-checkbox'; // signer checks/unchecks on the signing page
export interface SignatureFieldData {
id: string;
@@ -19,6 +21,7 @@ export interface SignatureFieldData {
height: number; // PDF points (default: 36 — 0.5 inches)
type?: SignatureFieldType; // Optional — v1.0 documents have no type; fallback = 'client-signature'
signerEmail?: string; // Optional — absent = legacy single-signer or agent-owned field
hint?: string; // Optional label shown to signer for client-text / client-checkbox fields
}
/**