@konfuzio/document-validation-ui 0.1.39 → 0.1.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -264,11 +264,15 @@ export default {
264
264
  };
265
265
  });
266
266
 
267
- const selection_bbox = this.clientToBbox(
268
- this.page,
269
- this.selection.start,
270
- this.selection.end
271
- );
267
+ let selection_bbox = null;
268
+
269
+ if (this.selection && this.selection.start && this.selection.end) {
270
+ selection_bbox = this.clientToBbox(
271
+ this.page,
272
+ this.selection.start,
273
+ this.selection.end
274
+ );
275
+ }
272
276
 
273
277
  const annotationToCreate = {
274
278
  document: this.documentId,
@@ -276,9 +280,12 @@ export default {
276
280
  label: this.selectedLabel.id,
277
281
  is_correct: true,
278
282
  revised: false,
279
- selection_bbox,
280
283
  };
281
284
 
285
+ if (selection_bbox) {
286
+ annotationToCreate.selection_bbox = selection_bbox;
287
+ }
288
+
282
289
  if (this.selectedSet.id) {
283
290
  annotationToCreate.annotation_set = this.selectedSet.id;
284
291
  } else {