refactor(annotations): include bounding box info in mapped signature fields

- Added `x`, `y`, `width`, and `height` properties to form field mapping in `mapSignature`.
- Preserves original form field values while enriching them with annotation coordinates.
- No functional changes to annotation creation, deletion, or validation.
This commit is contained in:
2025-10-28 13:49:26 +01:00
parent 985ad4dc29
commit 39c12ada45

View File

@@ -321,11 +321,16 @@ function mapSignature(iJSON) {
// formFields
...iJSON.formFieldValues.filter(field => !field.name.includes("label")).map((field) => {
const nameParts = field.name.split('#');
const [x, y, width, height] = iJSON.annotations.find(iAnnot => iAnnot.id === field.name)?.bbox;
return {
elementId: Number(nameParts[2]),
name: nameParts[3],
value: field.value,
type: field.type
type: field.type,
x: x,
y: y,
width: width,
height: height
};
}),