@konfuzio/document-validation-ui 0.1.3-pre-release-1 → 0.1.3-pre-release-3

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,8 +1,8 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.1.3-pre-release-1",
3
+ "version": "0.1.3-pre-release-3",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
- "main": "src/main.js",
5
+ "main": "dist/app.js",
6
6
  "scripts": {
7
7
  "serve": "vue-cli-service serve",
8
8
  "build": "vue-cli-service build --name DocumentValidationUi ./src/main.js",
package/src/.DS_Store CHANGED
Binary file
@@ -390,7 +390,10 @@ export default {
390
390
 
391
391
  allEmptyLabels.map((label) => {
392
392
  const found = this.missingAnnotations.find(
393
- (l) => l.label === label.id && l.annotation_set === annotationSet.id
393
+ (l) =>
394
+ l.label === label.id &&
395
+ l.annotation_set === annotationSet.id &&
396
+ l.label_set === annotationSet.label_set.id
394
397
  );
395
398
 
396
399
  if (!found) {
@@ -88,14 +88,14 @@ export default {
88
88
  this.clientHeight = clientHeight;
89
89
  },
90
90
  /**
91
- * Scrolls the ScrollingDocument to the offset specified by scrollTop
91
+ * Scrolls the ScrollingDocument to the offset specified by scrollTop & scrollLeft (if zoomed in)
92
92
  * (i.e., another page).
93
93
  */
94
- onPageJump(scrollTop) {
95
- const actualScroll = scrollTop;
96
- this.$refs.scrollingDocument.scrollTop =
97
- // the 4 comes from the margin between pages
98
- actualScroll - (this.$refs.scrollingDocument.offsetTop + 4);
94
+ onPageJump(scrollTop, scrollLeft) {
95
+ const scrollY = scrollTop - (this.$refs.scrollingDocument.offsetTop + 4); // + 4 due to margin between pages
96
+ const scrollX = scrollLeft - this.$refs.scrollingDocument.offsetLeft - 4; // - 4 to add more space before the entity
97
+
98
+ this.$refs.scrollingDocument.scroll(scrollX, scrollY);
99
99
  },
100
100
  },
101
101
  };
@@ -109,7 +109,10 @@ export default {
109
109
  // to the focused annotation.
110
110
  this.$nextTick(() => {
111
111
  // Scroll to the annotation
112
- this.scrollTo(this.getYForBbox(this.documentAnnotationSelected.span));
112
+ this.scrollTo(
113
+ this.getYForBbox(this.documentAnnotationSelected.span),
114
+ this.getXForBbox(this.documentAnnotationSelected.span)
115
+ );
113
116
  });
114
117
  }
115
118
  },
@@ -123,7 +126,7 @@ export default {
123
126
  (this.page.number === number || this.page.number === number) &&
124
127
  !this.isElementFocused
125
128
  ) {
126
- this.$emit("page-jump", this.elementTop);
129
+ this.$emit("page-jump", this.elementTop, 0);
127
130
  }
128
131
  },
129
132
  },
@@ -161,12 +164,16 @@ export default {
161
164
  return this.bboxToRect(this.page, bbox).y;
162
165
  },
163
166
 
167
+ getXForBbox(bbox) {
168
+ return this.bboxToRect(this.page, bbox).x;
169
+ },
170
+
164
171
  /**
165
172
  * Scroll to a relative position in the page. It gets added
166
173
  * the page's element top and a padding margin.
167
174
  */
168
- scrollTo(y) {
169
- this.$emit("page-jump", this.elementTop + y - 80);
175
+ scrollTo(y, x) {
176
+ this.$emit("page-jump", this.elementTop + y - 80, x);
170
177
  },
171
178
  },
172
179
  };
@@ -283,7 +283,10 @@ const getters = {
283
283
 
284
284
  labels.map((label) => {
285
285
  const found = state.missingAnnotations.find(
286
- (l) => l.label === label.id && annotationSet.id === l.annotation_set
286
+ (l) =>
287
+ l.label === label.id &&
288
+ annotationSet.id === l.annotation_set &&
289
+ annotationSet.label_set.id === l.label_set
287
290
  );
288
291
 
289
292
  if (!found) {