@konfuzio/document-validation-ui 0.1.11-dev.5 → 0.1.11-dev.7

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.11-dev.5",
3
+ "version": "0.1.11-dev.7",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -125,6 +125,7 @@
125
125
  right: 0;
126
126
  margin: 0 auto;
127
127
  padding: 10px;
128
+ z-index: 999;
128
129
 
129
130
  .split-info-bar {
130
131
  padding: 5px 13px;
@@ -218,7 +219,11 @@
218
219
  }
219
220
 
220
221
  .smart-split {
221
- .switch {
222
+ .switch-info {
223
+ display: flex;
224
+ align-items: center;
225
+ gap: 8px;
226
+
222
227
  .control-label {
223
228
  .switch-text {
224
229
  font-size: 14px;
@@ -81,9 +81,6 @@ export default {
81
81
  isAnnotationBeingEdited() {
82
82
  return this.isAnnotationInEditMode(this.annotation.id, this.spanIndex);
83
83
  },
84
- annotationText() {
85
- return this.$refs.contentEditable.textContent.trim();
86
- },
87
84
  },
88
85
 
89
86
  watch: {
@@ -116,6 +113,9 @@ export default {
116
113
  setText(text) {
117
114
  this.$refs.contentEditable.textContent = text;
118
115
  },
116
+ getAnnotationText() {
117
+ return this.$refs.contentEditable.textContent.trim();
118
+ },
119
119
  handleEditAnnotation(event) {
120
120
  if (this.publicView || this.isDocumentReviewed) return;
121
121
 
@@ -199,7 +199,7 @@ export default {
199
199
  // Validate if we are declining an Annotation that is not multi-lined
200
200
  // by deleting the content instead of clicking the 'decline' button
201
201
  let isToDecline =
202
- this.annotationText.length === 0 &&
202
+ this.getAnnotationText().length === 0 &&
203
203
  (!isElementArray(this.annotation.span) ||
204
204
  this.annotation.span.length === 1);
205
205
 
@@ -207,10 +207,11 @@ export default {
207
207
  this.$emit("save-annotation-changes", isToDecline);
208
208
  },
209
209
  createSpan() {
210
- if (this.annotationText.length === 0) return;
210
+ const annotationText = this.getAnnotationText();
211
+ if (!annotationText) return;
211
212
 
212
213
  return {
213
- offset_string: this.annotationText,
214
+ offset_string: annotationText,
214
215
  page_index: this.span.page_index,
215
216
  x0: this.span.x0,
216
217
  x1: this.span.x1,
@@ -459,10 +459,11 @@ export default {
459
459
  if (!decline) {
460
460
  Object.keys(this.$refs).forEach((ref) => {
461
461
  if (ref.includes(`span_${this.annotation.id}`)) {
462
+ const refElement = this.$refs[ref][0];
462
463
  // call child component createSpan method
463
- if (!this.$refs[ref][0]) return;
464
+ if (!refElement) return;
464
465
 
465
- const span = this.$refs[ref][0].createSpan();
466
+ const span = refElement.createSpan();
466
467
 
467
468
  // only add span if it's not null (offset_string not empty)
468
469
  if (span) {
@@ -55,14 +55,15 @@
55
55
  :value="true"
56
56
  size="is-small"
57
57
  :disabled="!documentHasProposedSplit(selectedDocument)"
58
- >
58
+ />
59
+ <div class="switch-info">
59
60
  <span class="switch-text">{{ $t("smart_split") }}</span>
60
61
  <span
61
62
  v-if="documentHasProposedSplit(selectedDocument)"
62
63
  class="new-badge"
63
64
  >{{ newText }}</span
64
65
  >
65
- </b-switch>
66
+ </div>
66
67
  </b-field>
67
68
  </b-tooltip>
68
69
  </div>