@konfuzio/document-validation-ui 0.1.5-automatic-document-splitting-2 → 0.1.5-pre-release-1

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.
Files changed (38) hide show
  1. package/dist/css/app.css +1 -1
  2. package/dist/index.html +1 -1
  3. package/dist/js/app.js +1 -1
  4. package/dist/js/app.js.map +1 -1
  5. package/package.json +1 -1
  6. package/src/assets/images/ServerImage.vue +2 -2
  7. package/src/assets/images/SplitZigZag.vue +14 -47
  8. package/src/assets/scss/document_category.scss +1 -0
  9. package/src/assets/scss/document_dashboard.scss +0 -6
  10. package/src/assets/scss/document_edit.scss +46 -131
  11. package/src/assets/scss/document_top_bar.scss +1 -1
  12. package/src/assets/scss/variables.scss +3 -63
  13. package/src/components/DocumentAnnotations/AnnotationContent.vue +1 -1
  14. package/src/components/DocumentAnnotations/CategorizeModal.vue +2 -22
  15. package/src/components/DocumentAnnotations/DocumentAnnotations.vue +3 -11
  16. package/src/components/DocumentCategory.vue +5 -13
  17. package/src/components/DocumentDashboard.vue +6 -17
  18. package/src/components/DocumentEdit/DocumentEdit.vue +69 -207
  19. package/src/components/DocumentEdit/EditPages.vue +18 -29
  20. package/src/components/DocumentEdit/EditSidebar.vue +45 -95
  21. package/src/components/DocumentEdit/SplitOverview.vue +5 -4
  22. package/src/components/{DocumentModals/DocumentErrorModal.vue → DocumentError.vue} +4 -3
  23. package/src/components/DocumentPage/ScrollingDocument.vue +2 -2
  24. package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +20 -6
  25. package/src/components/{DocumentModals/NotOptimizedViewportModal.vue → NotOptimizedViewportModal.vue} +2 -2
  26. package/src/locales/de.json +2 -15
  27. package/src/locales/en.json +1 -15
  28. package/src/locales/es.json +1 -14
  29. package/src/store/document.js +19 -49
  30. package/src/store/edit.js +48 -66
  31. package/src/store/project.js +14 -14
  32. package/src/assets/images/MagicWandIcon.vue +0 -16
  33. package/src/assets/images/StarIcon.vue +0 -16
  34. package/src/assets/scss/splitting_confirmation_modal.scss +0 -41
  35. package/src/components/DocumentEdit/EditConfirmationModal.vue +0 -54
  36. package/src/components/DocumentEdit/SidebarButtons.vue +0 -53
  37. package/src/components/DocumentEdit/SplitInfoBar.vue +0 -19
  38. package/src/components/DocumentModals/SplittingSuggestionsModal.vue +0 -121
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.1.5-automatic-document-splitting-2",
3
+ "version": "0.1.5-pre-release-1",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -17,11 +17,11 @@ export default {
17
17
  },
18
18
  height: {
19
19
  default: null,
20
- type: String,
20
+ type: Number,
21
21
  },
22
22
  width: {
23
23
  default: null,
24
- type: String,
24
+ type: Number,
25
25
  },
26
26
  },
27
27
  data() {
@@ -1,49 +1,16 @@
1
1
  <template>
2
- <div>
3
- <svg
4
- v-if="color === 'dark'"
5
- width="6"
6
- height="57"
7
- viewBox="0 0 6 57"
8
- fill="none"
9
- xmlns="http://www.w3.org/2000/svg"
10
- >
11
- <path
12
- d="M1 1L5 7.875L1 14.75L5 21.625L1 28.5L5 35.375L1 42.25L5 49.125L1 56"
13
- stroke="#1A1A1A"
14
- stroke-linecap="round"
15
- stroke-linejoin="round"
16
- />
17
- </svg>
18
-
19
- <svg
20
- v-if="color === 'green'"
21
- width="6"
22
- height="52"
23
- viewBox="0 0 6 52"
24
- fill="none"
25
- xmlns="http://www.w3.org/2000/svg"
26
- >
27
- <path
28
- d="M1 1.67383L5 7.81966L1 13.9655L5 20.1113L1 26.2572L5 32.403L1 38.5488L5 44.6947L1 50.8405"
29
- stroke="#44B78B"
30
- stroke-width="1.5"
31
- stroke-linecap="round"
32
- stroke-linejoin="round"
33
- />
34
- </svg>
35
- </div>
2
+ <svg
3
+ width="6"
4
+ height="57"
5
+ viewBox="0 0 6 57"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ >
9
+ <path
10
+ d="M1 1L5 7.875L1 14.75L5 21.625L1 28.5L5 35.375L1 42.25L5 49.125L1 56"
11
+ stroke="#1A1A1A"
12
+ stroke-linecap="round"
13
+ stroke-linejoin="round"
14
+ />
15
+ </svg>
36
16
  </template>
37
-
38
- <script>
39
- export default {
40
- name: "SplitZigZag",
41
- props: {
42
- color: {
43
- type: String,
44
- default: null,
45
- required: false,
46
- },
47
- },
48
- };
49
- </script>
@@ -42,6 +42,7 @@
42
42
 
43
43
  .category-info {
44
44
  min-width: 100px;
45
+ width: 100px;
45
46
  margin-left: 5px;
46
47
  margin-right: 5px;
47
48
 
@@ -25,12 +25,6 @@
25
25
  background-size: 9px 9px;
26
26
  }
27
27
 
28
- &.edit-mode {
29
- .dashboard-document {
30
- flex: 1.5;
31
- }
32
- }
33
-
34
28
  @media print {
35
29
  .dashboard-document {
36
30
  position: static;
@@ -7,6 +7,7 @@
7
7
 
8
8
  &.split-overview-component {
9
9
  min-width: 600px;
10
+ flex: 0;
10
11
  }
11
12
 
12
13
  .pages-section {
@@ -14,9 +15,6 @@
14
15
  overflow-y: scroll;
15
16
  border-right: $component-border;
16
17
  border-left: $component-border;
17
- display: flex;
18
- flex-direction: column;
19
- justify-content: space-between;
20
18
 
21
19
  .document-grid {
22
20
  padding: 42px;
@@ -167,128 +165,86 @@
167
165
  }
168
166
  }
169
167
  }
170
-
171
- .info-bar {
172
- position: sticky;
173
- width: -moz-fit-content;
174
- width: fit-content;
175
- bottom: 20px;
176
- left: 0;
177
- right: 0;
178
- margin: 0 auto;
179
- padding: 10px;
180
-
181
- .split-info-bar {
182
- padding: 5px 13px;
183
- min-height: 32px;
184
- height: auto;
185
- display: flex;
186
- align-items: center;
187
- justify-content: center;
188
- gap: 3px;
189
- background-color: $text-color;
190
- color: $white;
191
- font-weight: 400;
192
- font-size: 14px;
193
- border-radius: 52px;
194
- text-align: center;
195
- }
196
- }
197
168
  }
198
169
 
199
170
  .sidebar {
200
171
  width: 45%;
201
- max-width: 300px;
202
- min-width: 270px;
203
172
  background-color: $background;
204
173
 
205
174
  .edit-sidebar {
206
175
  display: flex;
207
176
  flex-direction: column;
208
177
  align-items: center;
209
- justify-content: flex-start;
178
+ justify-content: center;
210
179
  text-align: center;
211
- height: 100%;
180
+ height: calc(100% - 60px);
181
+ gap: 50px;
182
+
183
+ .sidebar-header {
184
+ width: 85%;
185
+ height: 50%;
186
+
187
+ h3 {
188
+ color: $text-color;
189
+ font-weight: 600;
190
+ font-size: 16px;
191
+ line-height: 24px;
192
+ padding-bottom: 15px;
193
+ }
194
+
195
+ .description {
196
+ color: $grey;
197
+ font-size: 14px;
198
+ font-weight: 400;
199
+ line-height: 20px;
200
+
201
+ &:last-child {
202
+ padding-top: 12px;
203
+ }
204
+ }
205
+ }
212
206
 
213
207
  .buttons-container {
214
208
  width: 85%;
215
209
  display: flex;
216
210
  flex-direction: column;
211
+ gap: 24px;
217
212
  color: $grey-dark;
218
213
 
219
214
  .pages-selected {
220
215
  font-weight: 400;
221
216
  font-size: 14px;
222
- margin-bottom: 15px;
223
217
 
224
218
  &.disabled {
225
219
  color: $grey;
226
220
  }
227
221
  }
228
222
 
229
- .edit-buttons {
223
+ .rotate {
230
224
  display: flex;
231
225
  flex-direction: column;
232
226
  gap: 8px;
233
- border-bottom: 1px solid $grey-detail;
234
-
235
- .sidebar-buttons {
236
- .edit-mode-btn {
237
- display: flex;
238
- width: 100%;
239
-
240
- .button-content {
241
- display: flex;
242
- align-items: center;
243
- justify-content: center;
244
- gap: 9px;
245
-
246
- .button-text {
247
- font-size: 14px;
248
- font-weight: 500;
249
- max-width: 70%;
250
- }
251
- }
252
- }
253
-
254
- &:first-child {
255
- margin-top: 14px;
256
- }
257
-
258
- &:last-child {
259
- margin-bottom: 14px;
260
- }
261
- }
227
+ }
262
228
 
263
- &:first-child {
264
- margin-top: 14px;
265
- }
229
+ .rotate-button {
230
+ display: flex;
231
+ align-items: center;
232
+ justify-content: center;
233
+ padding: 0 !important;
234
+ white-space: initial;
235
+ line-height: 1;
236
+ gap: 5px;
266
237
 
267
- &:last-child {
268
- margin-bottom: 14px;
269
- }
270
- }
271
- }
238
+ .button-content {
239
+ display: flex;
240
+ align-items: center;
241
+ justify-content: center;
272
242
 
273
- .smart-split {
274
- .switch {
275
- .control-label {
276
- .switch-text {
277
- font-size: 14px;
278
- padding-right: 10px;
279
- color: $grey-dark;
280
- font-weight: 500;
243
+ .button-text {
244
+ font-size: 16px;
245
+ max-width: 70%;
281
246
  }
282
247
  }
283
-
284
- .new-badge {
285
- background: linear-gradient(90deg, #c1ff79 0%, #79fff7 100%);
286
- border-radius: 36px;
287
- font-weight: 700;
288
- font-size: 11px;
289
- padding: 5px;
290
- color: $text-color;
291
- }
292
248
  }
293
249
  }
294
250
  }
@@ -472,45 +428,4 @@
472
428
  }
473
429
  }
474
430
  }
475
-
476
- .confirmation-modal-container {
477
- .edit-confirmation-modal {
478
- .header {
479
- display: flex;
480
- align-items: center;
481
- gap: 8px;
482
- padding-bottom: 15px;
483
- font-weight: 500;
484
- font-size: 18px;
485
- }
486
-
487
- .content {
488
- text-align: left;
489
- font-weight: 400;
490
- font-size: 14px;
491
- color: $grey-blue;
492
- }
493
-
494
- .modal-card-foot {
495
- display: flex;
496
- gap: 5px;
497
-
498
- .recommended {
499
- font-weight: 600;
500
- font-size: 11px;
501
- background-color: rgba(255, 255, 255, 0.2);
502
- padding: 2px 5px;
503
- border-radius: 36px;
504
- }
505
-
506
- .button {
507
- width: 100%;
508
-
509
- &.is-primary {
510
- font-weight: 500;
511
- }
512
- }
513
- }
514
- }
515
- }
516
431
  }
@@ -14,7 +14,7 @@
14
14
  .document-top-bar {
15
15
  width: 100%;
16
16
  height: 100%;
17
- background-color: $background;
17
+ background-color: $top-bar-background;
18
18
  position: sticky;
19
19
  z-index: 39;
20
20
  display: flex;
@@ -42,12 +42,14 @@ $text-color: #1a1a1a;
42
42
  :root {
43
43
  --primary-color: #{$konfuzio-green};
44
44
  --primary-button: 4px;
45
+ --top-bar-background: #{$white};
45
46
  }
46
47
 
47
48
  $primary: var(--primary-color);
48
49
  $hover-style: brightness(0.8) contrast(160%) grayscale(0.4);
49
50
  $font-family: "Inter", sans-serif;
50
51
  $background: $white;
52
+ $top-bar-background: var(--top-bar-background);
51
53
  $toolbar: $text-color;
52
54
  $tooltip: $dark;
53
55
  $toolbar-elements: $white;
@@ -152,7 +154,7 @@ button {
152
154
  }
153
155
  }
154
156
 
155
- &.edit-mode-btn[disabled] {
157
+ &.rotate-button[disabled] {
156
158
  border: 1px solid $detail;
157
159
  }
158
160
 
@@ -379,10 +381,6 @@ button {
379
381
  .modal-card-body {
380
382
  background: $white;
381
383
  border-radius: 16px 16px 0 0 !important;
382
-
383
- &.split-modal {
384
- padding-bottom: 0;
385
- }
386
384
  }
387
385
 
388
386
  .modal-card-foot {
@@ -399,16 +397,6 @@ button {
399
397
  position: absolute;
400
398
  }
401
399
 
402
- &.edit-modal {
403
- .modal-content {
404
- max-width: 441px !important;
405
-
406
- .modal-card-body {
407
- padding-bottom: 10px;
408
- }
409
- }
410
- }
411
-
412
400
  .modal-background {
413
401
  background-color: $full-black;
414
402
  opacity: 0.5;
@@ -524,12 +512,6 @@ button {
524
512
  right: 0 !important;
525
513
  }
526
514
  }
527
-
528
- &.finish-review {
529
- .tooltip-content {
530
- right: 0 !important;
531
- }
532
- }
533
515
  }
534
516
 
535
517
  &.width-184 {
@@ -570,35 +552,6 @@ button {
570
552
  }
571
553
  }
572
554
  }
573
-
574
- &.split-tooltip {
575
- width: 100%;
576
- }
577
-
578
- &.bottom-aligned {
579
- width: 100%;
580
- bottom: 10px;
581
-
582
- .tooltip-content {
583
- &::before {
584
- border-bottom-color: $text-color !important;
585
- }
586
-
587
- a {
588
- color: $white;
589
- text-decoration: underline;
590
- font-weight: 500;
591
- }
592
- }
593
- }
594
-
595
- &.top-aligned {
596
- .tooltip-content {
597
- &::before {
598
- border-top-color: $text-color !important;
599
- }
600
- }
601
- }
602
555
  }
603
556
 
604
557
  .rejected-tag-container {
@@ -771,16 +724,3 @@ button {
771
724
  }
772
725
  }
773
726
  }
774
-
775
- .switch {
776
- input[type="checkbox"] {
777
- &:checked + .check {
778
- background: $primary !important;
779
- box-shadow: none !important;
780
- }
781
-
782
- &:focus + .check {
783
- box-shadow: none !important;
784
- }
785
- }
786
- }
@@ -41,7 +41,7 @@ export default {
41
41
  required: true,
42
42
  },
43
43
  span: {
44
- type: [Object, Array],
44
+ type: Object,
45
45
  required: true,
46
46
  },
47
47
  spanIndex: {
@@ -105,18 +105,9 @@ export default {
105
105
  },
106
106
  computed: {
107
107
  ...mapState("category", ["categories"]),
108
- ...mapState("document", [
109
- "selectedDocument",
110
- "categorizeModalIsActive",
111
- "splittingSuggestions",
112
- ]),
108
+ ...mapState("document", ["selectedDocument"]),
113
109
  ...mapGetters("category", ["category", "projectHasSingleCategory"]),
114
110
  ...mapGetters("document", ["categorizationIsConfirmed"]),
115
-
116
- singleCategoryInProject() {
117
- // if only 1 category in the project, we don't enable the dropdown
118
- return this.categories && this.categories.length === 1;
119
- },
120
111
  },
121
112
  watch: {
122
113
  selectedDocument(newValue) {
@@ -136,13 +127,6 @@ export default {
136
127
  show(newValue) {
137
128
  this.$store.dispatch("display/setCategorizeModalIsActive", newValue);
138
129
  },
139
- categorizeModalIsActive(newValue) {
140
- // Show modal after split suggestion modal
141
- // if no category confirmed
142
- if (newValue) {
143
- this.show = newValue && !this.categorizationIsConfirmed;
144
- }
145
- },
146
130
  },
147
131
  mounted() {
148
132
  this.setDocumentValues();
@@ -175,11 +159,7 @@ export default {
175
159
  }
176
160
 
177
161
  this.selectedCategory = category;
178
- this.documentCategory = category;
179
-
180
- // By default, if the document has no category, the categorize modal is shown
181
- // But if there is a category, we also need to check if there are splitting suggestions or not
182
- this.show = !category || (category && !this.splittingSuggestions);
162
+ this.show = !this.categorizationIsConfirmed;
183
163
  }
184
164
  },
185
165
  canCloseModal() {
@@ -14,9 +14,7 @@
14
14
 
15
15
  <!-- When there's no annotations in the label -->
16
16
  <div v-else-if="annotationSets.length === 0">
17
- <CategorizeModal
18
- v-if="!publicView && !waitingForSplittingConfirmation(selectedDocument)"
19
- />
17
+ <CategorizeModal v-if="!publicView" />
20
18
  <EmptyState />
21
19
  </div>
22
20
 
@@ -27,9 +25,7 @@
27
25
  missingAnnotations.length && !publicView && 'showing-rejected',
28
26
  ]"
29
27
  >
30
- <CategorizeModal
31
- v-if="!publicView && !waitingForSplittingConfirmation(selectedDocument)"
32
- />
28
+ <CategorizeModal v-if="!publicView" />
33
29
  <div
34
30
  v-for="(annotationSet, indexGroup) in annotationSets"
35
31
  :key="indexGroup"
@@ -127,13 +123,9 @@ export default {
127
123
  "loading",
128
124
  "labels",
129
125
  "selectedDocument",
130
- "splittingSuggestions",
131
126
  ]),
132
127
  ...mapGetters("category", ["category"]),
133
- ...mapGetters("document", [
134
- "numberOfAnnotationSetGroup",
135
- "waitingForSplittingConfirmation",
136
- ]),
128
+ ...mapGetters("document", ["numberOfAnnotationSetGroup"]),
137
129
  isAnnotationBeingEdited() {
138
130
  return this.editAnnotation && this.editAnnotation.id;
139
131
  },
@@ -29,7 +29,11 @@
29
29
  {{ $t("category") }}
30
30
  </p>
31
31
  <div class="category-name">
32
- {{ setCategoryDefaultText }}
32
+ {{
33
+ !splitMode
34
+ ? categoryName(selectedDocument.category)
35
+ : categoryName(updatedDocument[index].category)
36
+ }}
33
37
  </div>
34
38
  </div>
35
39
  <div :class="[!splitMode && 'caret-section']">
@@ -98,18 +102,6 @@ export default {
98
102
  ...mapState("document", ["selectedDocument", "annotations"]),
99
103
  ...mapState("category", ["categories"]),
100
104
  ...mapState("edit", ["editMode", "updatedDocument"]),
101
-
102
- setCategoryDefaultText() {
103
- if (!this.splitMode) {
104
- return this.categoryName(this.selectedDocument.category);
105
- } else {
106
- const categoryName = this.categoryName(
107
- this.updatedDocument[this.index].category
108
- );
109
-
110
- return categoryName ? categoryName : this.$t("choose_category");
111
- }
112
- },
113
105
  },
114
106
  watch: {
115
107
  categories(newValue) {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="dashboard">
3
3
  <DocumentTopBar />
4
- <div :class="['dashboard-viewer', splitOverview ? 'edit-mode' : '']">
4
+ <div :class="['dashboard-viewer', editMode ? 'edit-mode' : '']">
5
5
  <DocumentThumbnails v-if="!editMode" ref="documentPages" />
6
6
  <ScrollingDocument ref="scrollingDocument" class="dashboard-document" />
7
7
  <DocumentAnnotations v-if="!editMode" ref="annotations" />
@@ -18,7 +18,7 @@
18
18
  </transition>
19
19
  </div>
20
20
  <div v-if="showDocumentError" class="error-modal">
21
- <DocumentErrorModal />
21
+ <DocumentError />
22
22
  </div>
23
23
  <div v-if="!optimalResolution" class="not-optimized">
24
24
  <NotOptimizedViewportModal />
@@ -28,13 +28,6 @@
28
28
  {{ $t("resolution_not_supported") }}
29
29
  </div>
30
30
  </div>
31
- <div
32
- v-if="
33
- selectedDocument && waitingForSplittingConfirmation(selectedDocument)
34
- "
35
- >
36
- <SplittingSuggestionsModal />
37
- </div>
38
31
  </div>
39
32
  </template>
40
33
 
@@ -46,9 +39,8 @@ import { DocumentThumbnails } from "./DocumentThumbnails";
46
39
  import { DocumentAnnotations } from "./DocumentAnnotations";
47
40
  import { DocumentEdit } from "./DocumentEdit";
48
41
  import ErrorMessage from "./ErrorMessage";
49
- import NotOptimizedViewportModal from "../components/DocumentModals/NotOptimizedViewportModal";
50
- import DocumentErrorModal from "../components/DocumentModals/DocumentErrorModal";
51
- import SplittingSuggestionsModal from "../components/DocumentModals/SplittingSuggestionsModal";
42
+ import NotOptimizedViewportModal from "./NotOptimizedViewportModal";
43
+ import DocumentError from "./DocumentError";
52
44
 
53
45
  /**
54
46
  * This component shows the PDF pages in a scrolling component and
@@ -64,8 +56,7 @@ export default {
64
56
  DocumentEdit,
65
57
  ErrorMessage,
66
58
  NotOptimizedViewportModal,
67
- DocumentErrorModal,
68
- SplittingSuggestionsModal,
59
+ DocumentError,
69
60
  },
70
61
  data() {
71
62
  return {
@@ -86,11 +77,9 @@ export default {
86
77
  "showDocumentError",
87
78
  "errorMessageWidth",
88
79
  "selectedDocument",
89
- "splittingSuggestions",
90
80
  ]),
91
- ...mapState("edit", ["editMode", "splitOverview"]),
81
+ ...mapState("edit", ["editMode"]),
92
82
  ...mapGetters("display", ["isMinimumWidth"]),
93
- ...mapGetters("document", ["waitingForSplittingConfirmation"]),
94
83
  },
95
84
  watch: {
96
85
  selectedDocument(newDocument, oldDocument) {