@konfuzio/document-validation-ui 0.1.12-dev.2 → 0.1.12-dev.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.1.12-dev.2",
3
+ "version": "0.1.12-dev.3",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -227,19 +227,33 @@ export default {
227
227
  },
228
228
  watch: {
229
229
  sidebarAnnotationSelected(newSidebarAnnotationSelected) {
230
- if (
231
- newSidebarAnnotationSelected &&
232
- this.annotation &&
233
- this.annotation.id === newSidebarAnnotationSelected.annotation.id
234
- ) {
230
+ if (!newSidebarAnnotationSelected) return;
231
+
232
+ let annotationSelected;
233
+
234
+ if (newSidebarAnnotationSelected.annotation) {
235
+ annotationSelected = newSidebarAnnotationSelected.annotation;
236
+ } else {
237
+ annotationSelected = newSidebarAnnotationSelected;
238
+ }
239
+
240
+ if (this.annotation && this.annotation.id === annotationSelected.id) {
235
241
  clearTimeout(this.annotationAnimationTimeout);
236
242
 
243
+ let timeout;
244
+
245
+ if (!newSidebarAnnotationSelected.trigger) {
246
+ timeout = 600;
247
+ } else {
248
+ timeout = 1200;
249
+ }
250
+
237
251
  this.isSelected = true;
238
252
  // remove annotation selection after some time
239
253
  this.annotationAnimationTimeout = setTimeout(() => {
240
254
  this.$store.dispatch("document/setSidebarAnnotationSelected", null);
241
255
  this.isSelected = false;
242
- }, 1500);
256
+ }, timeout);
243
257
 
244
258
  // Check if sidebarAnnotationSelected changed from a click or hover
245
259
  if (newSidebarAnnotationSelected.trigger === "click") {
@@ -109,9 +109,18 @@ export default {
109
109
  !this.showAnnotationsGroup &&
110
110
  newSidebarAnnotationSelected
111
111
  ) {
112
+ let annotationSelected;
113
+
114
+ if (newSidebarAnnotationSelected.annotation) {
115
+ annotationSelected = newSidebarAnnotationSelected.annotation;
116
+ } else {
117
+ annotationSelected = newSidebarAnnotationSelected;
118
+ }
119
+
112
120
  const annotation = this.label.annotations.find(
113
- (ann) => ann.id === newSidebarAnnotationSelected.id
121
+ (ann) => ann.id === annotationSelected.id
114
122
  );
123
+
115
124
  if (annotation) {
116
125
  this.showAnnotationsGroup = true;
117
126
  this.$store.dispatch("document/setSidebarAnnotationSelected", null);