- Install @dnd-kit/core@^6.3.1 and @dnd-kit/utilities@^3.2.2 - Create FieldPlacer.tsx with DndContext, draggable palette token, droppable PDF zone - Implements Y-flip coordinate conversion (screenToPdfCoords / pdfToScreenCoords) - Fetches existing fields from GET /api/documents/[id]/fields on mount - Persists fields via PUT /api/documents/[id]/fields on every add/remove - Renders placed fields as absolute-positioned blue-bordered overlays with remove button - Default field size: 144x36 PDF points (2in x 0.5in at 72 DPI)
1.6 KiB
1.6 KiB