@konfuzio/document-validation-ui 0.2.5-dev.0 → 0.2.6-dev.0
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/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/dist/js/chunk-vendors.js +7 -7
- package/dist/js/chunk-vendors.js.map +1 -1
- package/package.json +2 -2
- package/src/assets/scss/document_page.scss +4 -1
- package/src/assets/scss/theme.scss +10 -0
- package/src/components/DocumentDashboard.vue +1 -1
- package/src/components/DocumentPage/DocumentPage.vue +15 -13
- package/src/store/display.js +5 -3
- package/src/store/selection.js +20 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@konfuzio/document-validation-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6-dev.0",
|
|
4
4
|
"repository": "https://github.com/konfuzio-ai/document-validation-ui",
|
|
5
5
|
"main": "dist/app.js",
|
|
6
6
|
"scripts": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"sass-loader": "^16.0.5",
|
|
36
36
|
"splitpanes": "^3.1.8",
|
|
37
37
|
"vue": "^3.5.13",
|
|
38
|
-
"vue-i18n": "^10.0.
|
|
38
|
+
"vue-i18n": "^10.0.8",
|
|
39
39
|
"vue-konva": "^3.2.1",
|
|
40
40
|
"vue3-observe-visibility": "^1.0.3",
|
|
41
41
|
"vuedraggable": "^4.1.0",
|
|
@@ -59,6 +59,16 @@
|
|
|
59
59
|
color: variables.$primary;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
.v-enter-active,
|
|
63
|
+
.v-leave-active {
|
|
64
|
+
transition: opacity 0.2s ease-in-out;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.v-enter-from,
|
|
68
|
+
.v-leave-to {
|
|
69
|
+
opacity: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
62
72
|
button {
|
|
63
73
|
&.is-primary {
|
|
64
74
|
background-color: variables.$primary !important;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<DocumentTopBar />
|
|
4
4
|
<div :class="['dashboard-viewer', renameAndCategorize ? 'edit-mode' : '']">
|
|
5
5
|
<DocumentThumbnails v-if="!editMode" ref="documentPages" />
|
|
6
|
-
<splitpanes class="default-theme">
|
|
6
|
+
<splitpanes class="default-theme" style="overflow:hidden;">
|
|
7
7
|
<pane :size="50" :min-size="10">
|
|
8
8
|
<ScrollingDocument
|
|
9
9
|
ref="scrollingDocument"
|
|
@@ -20,14 +20,15 @@
|
|
|
20
20
|
@close="closePopups"
|
|
21
21
|
/>
|
|
22
22
|
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
<Transition>
|
|
24
|
+
<div
|
|
25
|
+
v-if="showAnnotationLabel"
|
|
26
|
+
class="annotation-label"
|
|
27
|
+
:style="getAnnotationLabelPosition(showAnnotationLabel)"
|
|
28
|
+
>
|
|
29
|
+
{{ showAnnotationLabel && showAnnotationLabel.labelName }}
|
|
30
|
+
</div>
|
|
31
|
+
</Transition>
|
|
31
32
|
<AnnSetTableOptions v-if="showAnnSetTable" :page="page" />
|
|
32
33
|
|
|
33
34
|
<v-stage
|
|
@@ -527,9 +528,9 @@ export default {
|
|
|
527
528
|
annotationRect(bbox, annotationId, draggable) {
|
|
528
529
|
const selected = this.annotationId == annotationId && !this.searchEnabled;
|
|
529
530
|
const focused = this.isAnnotationFocused(annotationId);
|
|
530
|
-
let fillColor = "
|
|
531
|
-
let strokeWidth = 0;
|
|
532
|
-
let strokeColor = "";
|
|
531
|
+
let fillColor = "#c6ff91";
|
|
532
|
+
let strokeWidth = 0.4;
|
|
533
|
+
let strokeColor = "black";
|
|
533
534
|
|
|
534
535
|
// if annotation is selected
|
|
535
536
|
if (selected) {
|
|
@@ -539,7 +540,7 @@ export default {
|
|
|
539
540
|
} // if hovered
|
|
540
541
|
else if (focused) {
|
|
541
542
|
fillColor = "#67E9B7";
|
|
542
|
-
strokeWidth =
|
|
543
|
+
strokeWidth = 0.6;
|
|
543
544
|
strokeColor = "black";
|
|
544
545
|
}
|
|
545
546
|
return {
|
|
@@ -549,7 +550,8 @@ export default {
|
|
|
549
550
|
stroke: strokeColor,
|
|
550
551
|
name: "annotation",
|
|
551
552
|
draggable,
|
|
552
|
-
|
|
553
|
+
cornerRadius: 2,
|
|
554
|
+
...this.bboxToRect(this.page, bbox, focused),
|
|
553
555
|
};
|
|
554
556
|
},
|
|
555
557
|
getAnnotationLabelPosition(annotation) {
|
package/src/store/display.js
CHANGED
|
@@ -153,7 +153,7 @@ const getters = {
|
|
|
153
153
|
},
|
|
154
154
|
bboxToRect:
|
|
155
155
|
(state, getters) =>
|
|
156
|
-
(page, bbox,
|
|
156
|
+
(page, bbox, hasPadding = false) => {
|
|
157
157
|
const imageScale = getters.imageScale(page);
|
|
158
158
|
if (bbox.x0 && bbox.y0) {
|
|
159
159
|
const { x0, x1, y0, y1 } = bbox;
|
|
@@ -161,7 +161,7 @@ const getters = {
|
|
|
161
161
|
const rect = {
|
|
162
162
|
// left
|
|
163
163
|
x: new BigNumber(x0)
|
|
164
|
-
.minus(
|
|
164
|
+
.minus(hasPadding ? 1 : 0)
|
|
165
165
|
.times(state.scale)
|
|
166
166
|
.times(imageScale)
|
|
167
167
|
.div(PIXEL_RATIO)
|
|
@@ -169,13 +169,14 @@ const getters = {
|
|
|
169
169
|
// top
|
|
170
170
|
y: pageHeight
|
|
171
171
|
.minus(new BigNumber(y1))
|
|
172
|
-
.minus(
|
|
172
|
+
.minus(hasPadding ? 1 : 0)
|
|
173
173
|
.times(state.scale)
|
|
174
174
|
.times(imageScale)
|
|
175
175
|
.div(PIXEL_RATIO)
|
|
176
176
|
.toNumber(),
|
|
177
177
|
width: new BigNumber(x1)
|
|
178
178
|
.minus(x0)
|
|
179
|
+
.plus(hasPadding ? 2 : 0)
|
|
179
180
|
.abs()
|
|
180
181
|
.times(state.scale)
|
|
181
182
|
.times(imageScale)
|
|
@@ -183,6 +184,7 @@ const getters = {
|
|
|
183
184
|
.toNumber(),
|
|
184
185
|
height: new BigNumber(y1)
|
|
185
186
|
.minus(y0)
|
|
187
|
+
.plus(hasPadding ? 2 : 0)
|
|
186
188
|
.times(state.scale)
|
|
187
189
|
.times(imageScale)
|
|
188
190
|
.div(PIXEL_RATIO)
|
package/src/store/selection.js
CHANGED
|
@@ -88,27 +88,29 @@ const actions = {
|
|
|
88
88
|
let xDiff;
|
|
89
89
|
let yDiff;
|
|
90
90
|
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
if (state.selection && state.selection.start) {
|
|
92
|
+
if (end) {
|
|
93
|
+
xDiff = Math.abs(state.selection.start.x - end.x);
|
|
94
|
+
yDiff = Math.abs(state.selection.start.y - end.y);
|
|
95
|
+
}
|
|
95
96
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
97
|
+
// if "end" is not provided, start and end points are the same, or if we have a selection smaller than 5x5,
|
|
98
|
+
// just reset
|
|
99
|
+
if (
|
|
100
|
+
!end ||
|
|
101
|
+
(yDiff <= 5 && xDiff <= 5) ||
|
|
102
|
+
(state.selection.start.x === end.x && state.selection.start.y == end.y)
|
|
103
|
+
) {
|
|
104
|
+
commit("RESET_SELECTION");
|
|
105
|
+
} else {
|
|
106
|
+
state.selection.start.x = state.selection.start.x - selectionPadding;
|
|
107
|
+
state.selection.start.y = state.selection.start.y - selectionPadding;
|
|
107
108
|
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
end.x = end.x + selectionPadding;
|
|
110
|
+
end.y = end.y + selectionPadding;
|
|
110
111
|
|
|
111
|
-
|
|
112
|
+
commit("END_SELECTION", end);
|
|
113
|
+
}
|
|
112
114
|
}
|
|
113
115
|
},
|
|
114
116
|
|