@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/README.md +9 -8
- package/dist/css/app.css +1 -1
- package/dist/index.html +1 -1
- package/dist/js/app.js +1 -1
- package/dist/js/app.js.map +1 -1
- package/package.json +2 -2
- package/src/.DS_Store +0 -0
- package/src/components/DocumentAnnotations/DocumentAnnotations.vue +4 -1
- package/src/components/DocumentPage/ScrollingDocument.vue +6 -6
- package/src/components/DocumentPage/ScrollingPage.vue +11 -4
- package/src/store/document.js +4 -1
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@konfuzio/document-validation-ui",
|
|
3
|
-
"version": "0.1.3-pre-release-
|
|
3
|
+
"version": "0.1.3-pre-release-3",
|
|
4
4
|
"repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
|
|
5
|
-
"main": "
|
|
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) =>
|
|
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
|
|
96
|
-
this.$refs.scrollingDocument.
|
|
97
|
-
|
|
98
|
-
|
|
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(
|
|
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
|
};
|
package/src/store/document.js
CHANGED
|
@@ -283,7 +283,10 @@ const getters = {
|
|
|
283
283
|
|
|
284
284
|
labels.map((label) => {
|
|
285
285
|
const found = state.missingAnnotations.find(
|
|
286
|
-
(l) =>
|
|
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) {
|