@konfuzio/document-validation-ui 0.1.5-styles-refactor → 0.1.6-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.
- 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 +1 -1
- package/src/.DS_Store +0 -0
- package/src/assets/images/MagicWandIcon.vue +16 -0
- package/src/assets/images/NotFoundIcon.vue +16 -0
- package/src/assets/images/SplitZigZag.vue +47 -14
- package/src/assets/images/StarIcon.vue +16 -0
- package/src/assets/scss/document_annotations.scss +9 -59
- package/src/assets/scss/document_category.scss +0 -1
- package/src/assets/scss/document_dashboard.scss +6 -0
- package/src/assets/scss/document_edit.scss +90 -46
- package/src/assets/scss/main.scss +67 -44
- package/src/assets/scss/splitting_confirmation_modal.scss +41 -0
- package/src/components/DocumentAnnotations/AnnotationActionButtons.vue +153 -0
- package/src/components/DocumentAnnotations/AnnotationDetails.vue +21 -4
- package/src/components/DocumentAnnotations/AnnotationRow.vue +97 -34
- package/src/components/DocumentAnnotations/AnnotationSetActionButtons.vue +86 -0
- package/src/components/DocumentAnnotations/CategorizeModal.vue +24 -2
- package/src/components/DocumentAnnotations/DocumentAnnotations.vue +77 -81
- package/src/components/DocumentAnnotations/EmptyAnnotation.vue +16 -3
- package/src/components/DocumentAnnotations/ExtractingData.vue +3 -3
- package/src/components/DocumentAnnotations/index.js +0 -1
- package/src/components/DocumentCategory.vue +13 -5
- package/src/components/DocumentDashboard.vue +17 -6
- package/src/components/DocumentEdit/DocumentEdit.vue +208 -68
- package/src/components/DocumentEdit/EditConfirmationModal.vue +54 -0
- package/src/components/DocumentEdit/EditPages.vue +29 -18
- package/src/components/DocumentEdit/EditSidebar.vue +92 -45
- package/src/components/DocumentEdit/SidebarButtons.vue +53 -0
- package/src/components/DocumentEdit/SplitInfoBar.vue +19 -0
- package/src/components/DocumentEdit/SplitOverview.vue +4 -5
- package/src/components/{DocumentError.vue → DocumentModals/DocumentErrorModal.vue} +3 -4
- package/src/components/{NotOptimizedViewportModal.vue → DocumentModals/NotOptimizedViewportModal.vue} +2 -2
- package/src/components/DocumentModals/SplittingSuggestionsModal.vue +120 -0
- package/src/components/DocumentPage/ActionBar.vue +3 -3
- package/src/components/DocumentPage/ScrollingDocument.vue +7 -3
- package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +35 -30
- package/src/components/DocumentTopBar/KeyboardActionsDescription.vue +3 -1
- package/src/locales/de.json +19 -6
- package/src/locales/en.json +20 -6
- package/src/locales/es.json +19 -6
- package/src/store/document.js +81 -17
- package/src/store/edit.js +67 -48
- package/src/store/project.js +14 -14
- package/src/components/DocumentAnnotations/ActionButtons.vue +0 -257
- package/src/components/DocumentAnnotations/RejectedLabels.vue +0 -96
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
<div :class="['document-edit', splitOverview && 'split-overview-component']">
|
|
3
3
|
<div v-if="!splitOverview" class="pages-section">
|
|
4
4
|
<EditPages
|
|
5
|
-
:
|
|
5
|
+
:splitting-lines="splittingLines"
|
|
6
|
+
:split-suggestions-enabled="splitSuggestionsEnabled"
|
|
6
7
|
@change-page="changePage"
|
|
7
8
|
@handle-splitting-lines="handleSplittingLines"
|
|
8
9
|
@check-move="checkMove"
|
|
9
10
|
@handle-drag-end="handleDragEnd"
|
|
10
11
|
/>
|
|
12
|
+
<div class="info-bar">
|
|
13
|
+
<SplitInfoBar v-if="splitSuggestionsEnabled" />
|
|
14
|
+
</div>
|
|
11
15
|
</div>
|
|
12
16
|
<div v-else class="split-overview-section">
|
|
13
17
|
<SplitOverview
|
|
@@ -22,8 +26,13 @@
|
|
|
22
26
|
@rotate-right="rotatePage"
|
|
23
27
|
@rotate-all-left="handleRotationsToTheLeft"
|
|
24
28
|
@rotate-all-right="handleRotationsToTheRight"
|
|
29
|
+
@handle-splitting-suggestions="applySplittingSuggestions"
|
|
30
|
+
:split-suggestions-enabled="splitSuggestionsEnabled"
|
|
25
31
|
/>
|
|
26
32
|
</div>
|
|
33
|
+
<div class="confirmation-modal-container">
|
|
34
|
+
<EditConfirmationModal @save-changes="saveEditChanges" />
|
|
35
|
+
</div>
|
|
27
36
|
</div>
|
|
28
37
|
</template>
|
|
29
38
|
<script>
|
|
@@ -31,6 +40,8 @@ import { mapState } from "vuex";
|
|
|
31
40
|
import EditSidebar from "./EditSidebar";
|
|
32
41
|
import SplitOverview from "./SplitOverview";
|
|
33
42
|
import EditPages from "./EditPages";
|
|
43
|
+
import SplitInfoBar from "./SplitInfoBar";
|
|
44
|
+
import EditConfirmationModal from "./EditConfirmationModal";
|
|
34
45
|
|
|
35
46
|
/**
|
|
36
47
|
* This component shows a document thumbnail grid view and sidebar, to be able to edit the document.
|
|
@@ -41,22 +52,29 @@ export default {
|
|
|
41
52
|
EditSidebar,
|
|
42
53
|
SplitOverview,
|
|
43
54
|
EditPages,
|
|
55
|
+
SplitInfoBar,
|
|
56
|
+
EditConfirmationModal,
|
|
44
57
|
},
|
|
45
58
|
data() {
|
|
46
59
|
return {
|
|
47
|
-
fileName:
|
|
60
|
+
fileName: null,
|
|
48
61
|
fileExtension: null,
|
|
49
|
-
|
|
62
|
+
splittingLines: [],
|
|
50
63
|
dragging: false,
|
|
51
64
|
prevPageAtIndex: null,
|
|
65
|
+
splitSuggestionsEnabled: false,
|
|
52
66
|
};
|
|
53
67
|
},
|
|
54
68
|
computed: {
|
|
55
|
-
...mapState("document", [
|
|
69
|
+
...mapState("document", [
|
|
70
|
+
"recalculatingAnnotations",
|
|
71
|
+
"selectedDocument",
|
|
72
|
+
"splittingSuggestions",
|
|
73
|
+
]),
|
|
56
74
|
...mapState("display", ["currentPage"]),
|
|
57
75
|
...mapState("edit", [
|
|
58
76
|
"editMode",
|
|
59
|
-
"
|
|
77
|
+
"pagesForPostprocess",
|
|
60
78
|
"updatedDocument",
|
|
61
79
|
"splitOverview",
|
|
62
80
|
"selectedPages",
|
|
@@ -65,6 +83,7 @@ export default {
|
|
|
65
83
|
watch: {
|
|
66
84
|
pages() {
|
|
67
85
|
if (!this.selectedDocument) return;
|
|
86
|
+
|
|
68
87
|
this.setPages();
|
|
69
88
|
},
|
|
70
89
|
splitOverview(newValue) {
|
|
@@ -72,9 +91,18 @@ export default {
|
|
|
72
91
|
this.splitFileNameFromExtension();
|
|
73
92
|
}
|
|
74
93
|
},
|
|
75
|
-
|
|
94
|
+
pagesForPostprocess(newValue) {
|
|
76
95
|
if (newValue) {
|
|
77
|
-
this.
|
|
96
|
+
this.saveUpdatedDocuments();
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
splittingLines(newValue) {
|
|
100
|
+
const aiSplit = newValue.find((item) => item.origin === "AI");
|
|
101
|
+
|
|
102
|
+
// If there are no AI suggestions left, because of being manually removed by the user
|
|
103
|
+
// the Smart Split switch should be turned off
|
|
104
|
+
if (!aiSplit) {
|
|
105
|
+
this.splitSuggestionsEnabled = false;
|
|
78
106
|
}
|
|
79
107
|
},
|
|
80
108
|
},
|
|
@@ -86,16 +114,30 @@ export default {
|
|
|
86
114
|
if (!this.selectedDocument) {
|
|
87
115
|
return;
|
|
88
116
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this.$store.dispatch(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.activeSplittingLines = new Array(
|
|
95
|
-
this.selectedDocument.pages.length - 1
|
|
117
|
+
|
|
118
|
+
// set array of pages only with the data we need for postprocessing the document
|
|
119
|
+
this.$store.dispatch(
|
|
120
|
+
"edit/setPagesForPostprocess",
|
|
121
|
+
this.createPagesForPostprocess()
|
|
96
122
|
);
|
|
123
|
+
|
|
124
|
+
// Create array with placeholder data for the splitting points
|
|
125
|
+
if (this.selectedDocument.pages.length > 0) {
|
|
126
|
+
this.selectedDocument.pages.map((page) => {
|
|
127
|
+
if (page.number === this.selectedDocument.pages.length) {
|
|
128
|
+
this.setSplittingArray(page.number, null);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
this.setSplittingArray(0, null);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
if (this.splittingSuggestions) {
|
|
135
|
+
this.splitSuggestionsEnabled = true;
|
|
136
|
+
this.setAutomaticSplitting();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
97
139
|
},
|
|
98
|
-
|
|
140
|
+
createPagesForPostprocess() {
|
|
99
141
|
return this.selectedDocument.pages.map((page) => {
|
|
100
142
|
return {
|
|
101
143
|
id: page.id,
|
|
@@ -137,6 +179,40 @@ export default {
|
|
|
137
179
|
},
|
|
138
180
|
|
|
139
181
|
/** SPLIT */
|
|
182
|
+
setAutomaticSplitting() {
|
|
183
|
+
// map over splitting suggestions to find the page number based on the page id
|
|
184
|
+
// to update the splittingLines array with this data
|
|
185
|
+
if (!this.splittingSuggestions) return;
|
|
186
|
+
|
|
187
|
+
this.splittingSuggestions.map((item) => {
|
|
188
|
+
const firstPage = this.selectedDocument.pages.find(
|
|
189
|
+
(page) => page.id === item.pages[0].id
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
if (firstPage.number === 1 && item.pages.length > 1) {
|
|
193
|
+
// only add the active splitting line from the 1st page of the second document
|
|
194
|
+
// since it's the first splitting point
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
this.handleSplittingLines(firstPage.number, "AI");
|
|
199
|
+
});
|
|
200
|
+
},
|
|
201
|
+
applySplittingSuggestions(value) {
|
|
202
|
+
// Show information bar
|
|
203
|
+
this.splitSuggestionsEnabled = value;
|
|
204
|
+
|
|
205
|
+
// Apply or remove split lines
|
|
206
|
+
this.setAutomaticSplitting();
|
|
207
|
+
},
|
|
208
|
+
setSplittingArray(pageNumber, splittingOrigin) {
|
|
209
|
+
// This function sets the splittingLines array
|
|
210
|
+
// based on splitting suggestions or no suggestions
|
|
211
|
+
this.splittingLines.push({
|
|
212
|
+
page: pageNumber,
|
|
213
|
+
origin: splittingOrigin,
|
|
214
|
+
});
|
|
215
|
+
},
|
|
140
216
|
splitFileNameFromExtension() {
|
|
141
217
|
if (!this.selectedDocument && !this.selectedDocument.data_file_name)
|
|
142
218
|
return;
|
|
@@ -152,57 +228,76 @@ export default {
|
|
|
152
228
|
.split(".")
|
|
153
229
|
.at(-1);
|
|
154
230
|
},
|
|
155
|
-
handleSplittingLines(page) {
|
|
156
|
-
//
|
|
157
|
-
// Add page number to specific index
|
|
158
|
-
// Or replace it with 0 (to keep the same index) if it exists
|
|
159
|
-
const found = this.
|
|
160
|
-
|
|
161
|
-
|
|
231
|
+
handleSplittingLines(page, origin) {
|
|
232
|
+
// To select and deselect the division lines
|
|
233
|
+
// Add page number & origin to specific index
|
|
234
|
+
// Or replace it with 0 (to keep the same index & array length) if it exists
|
|
235
|
+
const found = this.splittingLines.find((item) => item.page === page);
|
|
236
|
+
|
|
237
|
+
// new line added or removed based on the page clicked:
|
|
238
|
+
const newPage = { page: page, origin: origin };
|
|
239
|
+
const removedPage = { page: 0, origin: origin };
|
|
162
240
|
|
|
163
|
-
if (
|
|
164
|
-
this.
|
|
241
|
+
if (
|
|
242
|
+
page === this.splittingLines.length ||
|
|
243
|
+
(!this.splitSuggestionsEnabled && !found && origin === "AI")
|
|
244
|
+
) {
|
|
245
|
+
// check if it's the last item to keep unchanged
|
|
246
|
+
// Or if splitting is switched off, but some of the suggestion lines
|
|
247
|
+
// were removed manually
|
|
248
|
+
return;
|
|
249
|
+
} else if (this.splitSuggestionsEnabled && origin === "AI") {
|
|
250
|
+
// if manual suggestions were added but we enable automatic splitting,
|
|
251
|
+
// this last one takes over
|
|
252
|
+
this.splittingLines.splice(page - 1, 1, newPage);
|
|
253
|
+
} else if (found) {
|
|
254
|
+
// If splitting is switched off and we have manual splits,
|
|
255
|
+
// those should stay unchanged
|
|
256
|
+
if (!this.splitSuggestionsEnabled && found.origin !== origin) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
this.splittingLines.splice(page - 1, 1, removedPage);
|
|
165
261
|
} else {
|
|
166
|
-
this.
|
|
262
|
+
this.splittingLines.splice(page - 1, 1, newPage);
|
|
167
263
|
}
|
|
168
264
|
|
|
169
|
-
this.
|
|
265
|
+
this.saveUpdatedDocuments();
|
|
170
266
|
},
|
|
171
|
-
|
|
267
|
+
saveUpdatedDocuments() {
|
|
172
268
|
this.splitFileNameFromExtension();
|
|
173
269
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
270
|
+
const clickedLines = this.splittingLines.filter(
|
|
271
|
+
(item) => item.page !== 0
|
|
272
|
+
);
|
|
273
|
+
|
|
274
|
+
const newDocuments = this.createEachNewDocument(
|
|
275
|
+
clickedLines,
|
|
276
|
+
clickedLines.length
|
|
177
277
|
);
|
|
178
278
|
|
|
179
|
-
//
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
for (let i = 0; i <
|
|
186
|
-
const
|
|
187
|
-
name: this.
|
|
188
|
-
category: this.
|
|
189
|
-
pages: this.
|
|
279
|
+
// // Set the state to the created array
|
|
280
|
+
this.$store.dispatch("edit/setUpdatedDocument", newDocuments);
|
|
281
|
+
},
|
|
282
|
+
createEachNewDocument(clickedLines, length) {
|
|
283
|
+
const documents = new Array(length);
|
|
284
|
+
|
|
285
|
+
for (let i = 0; i < length; i++) {
|
|
286
|
+
const newDocument = {
|
|
287
|
+
name: this.handleNewDocumentName(i),
|
|
288
|
+
category: this.handleNewDocumentCategory(i, clickedLines),
|
|
289
|
+
pages: this.handleNewDocumentPages(i, clickedLines),
|
|
190
290
|
};
|
|
191
291
|
|
|
192
|
-
//
|
|
193
|
-
|
|
292
|
+
// we replace the "undefined" with the created object
|
|
293
|
+
documents.splice(i, 1, newDocument);
|
|
194
294
|
}
|
|
195
295
|
|
|
196
|
-
|
|
197
|
-
this.$store.dispatch("edit/setUpdatedDocument", pageObjectArray);
|
|
296
|
+
return documents;
|
|
198
297
|
},
|
|
199
|
-
|
|
298
|
+
handleNewDocumentName(index) {
|
|
200
299
|
let newFileName;
|
|
201
300
|
|
|
202
|
-
// Return original file name,
|
|
203
|
-
// file name + copy,
|
|
204
|
-
// or file name + copy + number
|
|
205
|
-
// based on where the object will be located in the array
|
|
206
301
|
if (index === 0) {
|
|
207
302
|
newFileName = this.selectedDocument.data_file_name;
|
|
208
303
|
} else if (index === 1) {
|
|
@@ -212,50 +307,95 @@ export default {
|
|
|
212
307
|
}
|
|
213
308
|
return newFileName;
|
|
214
309
|
},
|
|
215
|
-
|
|
216
|
-
|
|
310
|
+
handleNewDocumentCategory(index, clickedLines) {
|
|
311
|
+
if (clickedLines[index].origin && clickedLines[index].origin === "AI") {
|
|
312
|
+
// get the index of the new document in the splitting suggestions
|
|
313
|
+
// to return its category
|
|
314
|
+
const i = this.indexOfSplittingSuggestion(index, clickedLines);
|
|
315
|
+
|
|
316
|
+
return this.splittingSuggestions[i].category;
|
|
317
|
+
} else {
|
|
318
|
+
return this.selectedDocument.category;
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
handleNewDocumentPages(index, clickedLines) {
|
|
322
|
+
// assign the correct pages to each new document
|
|
217
323
|
let pages;
|
|
218
324
|
|
|
219
325
|
if (index === 0) {
|
|
220
|
-
pages = this.
|
|
221
|
-
0,
|
|
222
|
-
splittingLine[index]
|
|
223
|
-
);
|
|
326
|
+
pages = this.pagesForPostprocess.slice(0, clickedLines[index].page);
|
|
224
327
|
} else {
|
|
225
|
-
if (!
|
|
226
|
-
pages = this.
|
|
227
|
-
splittingLine[index - 1]
|
|
228
|
-
);
|
|
328
|
+
if (!clickedLines[index].page) {
|
|
329
|
+
pages = this.pagesForPostprocess.slice(clickedLines[index - 1].page);
|
|
229
330
|
} else {
|
|
230
|
-
pages = this.
|
|
231
|
-
|
|
232
|
-
|
|
331
|
+
pages = this.pagesForPostprocess.slice(
|
|
332
|
+
clickedLines[index - 1].page,
|
|
333
|
+
clickedLines[index].page
|
|
233
334
|
);
|
|
234
335
|
}
|
|
235
336
|
}
|
|
337
|
+
|
|
236
338
|
return pages;
|
|
237
339
|
},
|
|
340
|
+
indexOfSplittingSuggestion(index, clickedLines) {
|
|
341
|
+
const foundPage = this.selectedDocument.pages.find(
|
|
342
|
+
(page) => page.number === clickedLines[index].page
|
|
343
|
+
);
|
|
344
|
+
|
|
345
|
+
const singleSplittingSuggestion = this.splittingSuggestions.find(
|
|
346
|
+
(item) => item.pages[0].id === foundPage.id
|
|
347
|
+
);
|
|
348
|
+
|
|
349
|
+
return this.splittingSuggestions.indexOf(singleSplittingSuggestion);
|
|
350
|
+
},
|
|
238
351
|
|
|
239
352
|
/** SORT */
|
|
240
353
|
checkMove(e) {
|
|
241
354
|
// Save the page placed originally where the page we are dragging will go
|
|
242
|
-
this.prevPageAtIndex = this.
|
|
355
|
+
this.prevPageAtIndex = this.pagesForPostprocess.find(
|
|
243
356
|
(page) =>
|
|
244
|
-
this.
|
|
357
|
+
this.pagesForPostprocess.indexOf(page) ===
|
|
245
358
|
e.draggedContext.futureIndex
|
|
246
359
|
);
|
|
247
360
|
},
|
|
248
361
|
handleDragEnd() {
|
|
249
362
|
// Update page numbers
|
|
250
|
-
const pages = this.
|
|
251
|
-
const index = this.
|
|
363
|
+
const pages = this.pagesForPostprocess.map((page) => {
|
|
364
|
+
const index = this.pagesForPostprocess.indexOf(page);
|
|
252
365
|
return {
|
|
253
366
|
...page,
|
|
254
367
|
number: index + 1,
|
|
255
368
|
};
|
|
256
369
|
});
|
|
257
370
|
|
|
258
|
-
this.$store.dispatch("edit/
|
|
371
|
+
this.$store.dispatch("edit/setPagesForPostprocess", pages);
|
|
372
|
+
},
|
|
373
|
+
|
|
374
|
+
/** SUBMIT CHANGES */
|
|
375
|
+
// Send update request to the backend
|
|
376
|
+
saveEditChanges() {
|
|
377
|
+
this.$store
|
|
378
|
+
.dispatch("edit/editDocument", this.updatedDocument)
|
|
379
|
+
.catch((error) => {
|
|
380
|
+
this.$store.dispatch("document/createErrorMessage", {
|
|
381
|
+
error,
|
|
382
|
+
serverErrorMessage: this.$t("server_error"),
|
|
383
|
+
defaultErrorMessage: this.$t("edit_error"),
|
|
384
|
+
});
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
this.closeEditMode();
|
|
388
|
+
},
|
|
389
|
+
|
|
390
|
+
closeEditMode() {
|
|
391
|
+
this.$store.dispatch("edit/disableEditMode");
|
|
392
|
+
this.$store.dispatch("edit/setSplitOverview", false);
|
|
393
|
+
this.$store.dispatch("edit/setUpdatedDocument", null);
|
|
394
|
+
this.$store.dispatch("edit/setSelectedPages", null);
|
|
395
|
+
this.$nextTick(() => {
|
|
396
|
+
// reset to first page
|
|
397
|
+
this.$store.dispatch("display/updateCurrentPage", 1);
|
|
398
|
+
});
|
|
259
399
|
},
|
|
260
400
|
},
|
|
261
401
|
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="edit-confirmation-modal">
|
|
3
|
+
<b-modal v-model="isModalActive" :can-cancel="[]" class="edit-modal">
|
|
4
|
+
<section class="modal-card-body">
|
|
5
|
+
<div class="header">
|
|
6
|
+
<p class="modal-title">{{ $t("confirm_splitting") }}</p>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="content">{{ $t("splitting_warning") }}</div>
|
|
9
|
+
</section>
|
|
10
|
+
<footer class="modal-card-foot">
|
|
11
|
+
<b-button @click="closeModal">
|
|
12
|
+
{{ $t("no") }}
|
|
13
|
+
</b-button>
|
|
14
|
+
<b-button type="is-primary" @click="confirmChanges">
|
|
15
|
+
{{ $t("yes") }}
|
|
16
|
+
</b-button>
|
|
17
|
+
</footer>
|
|
18
|
+
</b-modal>
|
|
19
|
+
</section>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import { mapState } from "vuex";
|
|
24
|
+
/**
|
|
25
|
+
* This component shows a modal to confirm the edit changes in the document
|
|
26
|
+
*/
|
|
27
|
+
export default {
|
|
28
|
+
name: "EditConfirmationModal",
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
isModalActive: false,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
computed: {
|
|
35
|
+
...mapState("edit", ["showEditConfirmationModal"]),
|
|
36
|
+
},
|
|
37
|
+
watch: {
|
|
38
|
+
showEditConfirmationModal(newValue) {
|
|
39
|
+
this.isModalActive = newValue;
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
methods: {
|
|
43
|
+
closeModal() {
|
|
44
|
+
this.isModalActive = false;
|
|
45
|
+
this.$store.dispatch("edit/setShowEditConfirmationModal", false);
|
|
46
|
+
},
|
|
47
|
+
confirmChanges() {
|
|
48
|
+
this.$emit("save-changes");
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<style scoped lang="scss" src="../../assets/scss/document_edit.scss"></style>
|
|
@@ -48,23 +48,29 @@
|
|
|
48
48
|
<div
|
|
49
49
|
:class="[
|
|
50
50
|
'splitting-lines',
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
splittingLines &&
|
|
52
|
+
splittingLines[index].page === page.number &&
|
|
53
53
|
'active-split',
|
|
54
54
|
]"
|
|
55
|
-
@click="handleSplittingLines(page)"
|
|
55
|
+
@click="handleSplittingLines(page.number, 'manual')"
|
|
56
56
|
>
|
|
57
57
|
<div class="scissors-icon">
|
|
58
58
|
<b-icon icon="scissors" class="is-small" />
|
|
59
59
|
</div>
|
|
60
60
|
<div
|
|
61
|
-
v-if="
|
|
62
|
-
activeSplittingLines &&
|
|
63
|
-
activeSplittingLines[index] === page.number
|
|
64
|
-
"
|
|
61
|
+
v-if="splittingLines && splittingLines[index].page === page.number"
|
|
65
62
|
class="lines"
|
|
66
63
|
>
|
|
67
|
-
<SplitZigZag
|
|
64
|
+
<SplitZigZag
|
|
65
|
+
:color="
|
|
66
|
+
splittingLines &&
|
|
67
|
+
splittingLines[index].origin &&
|
|
68
|
+
splittingLines[index].origin === 'AI' &&
|
|
69
|
+
splitSuggestionsEnabled
|
|
70
|
+
? 'green'
|
|
71
|
+
: 'dark'
|
|
72
|
+
"
|
|
73
|
+
/>
|
|
68
74
|
</div>
|
|
69
75
|
<div v-else class="lines">
|
|
70
76
|
<SplitLines />
|
|
@@ -98,10 +104,14 @@ export default {
|
|
|
98
104
|
draggable,
|
|
99
105
|
},
|
|
100
106
|
props: {
|
|
101
|
-
|
|
107
|
+
splittingLines: {
|
|
102
108
|
type: Array,
|
|
103
109
|
default: null,
|
|
104
110
|
},
|
|
111
|
+
splitSuggestionsEnabled: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: false,
|
|
114
|
+
},
|
|
105
115
|
},
|
|
106
116
|
data() {
|
|
107
117
|
return {
|
|
@@ -109,39 +119,41 @@ export default {
|
|
|
109
119
|
selected: null,
|
|
110
120
|
};
|
|
111
121
|
},
|
|
122
|
+
|
|
112
123
|
computed: {
|
|
113
124
|
...mapState("document", [
|
|
114
125
|
"pages",
|
|
115
126
|
"recalculatingAnnotations",
|
|
116
127
|
"selectedDocument",
|
|
128
|
+
"splittingSuggestions",
|
|
117
129
|
]),
|
|
118
130
|
...mapState("edit", [
|
|
119
131
|
"editMode",
|
|
120
|
-
"
|
|
132
|
+
"pagesForPostprocess",
|
|
121
133
|
"splitOverview",
|
|
122
134
|
"selectedPages",
|
|
123
135
|
"splitOverview",
|
|
124
136
|
]),
|
|
125
137
|
},
|
|
126
138
|
watch: {
|
|
127
|
-
|
|
139
|
+
pagesForPostprocess(newValue, oldValue) {
|
|
128
140
|
if (newValue !== oldValue) {
|
|
129
141
|
this.editPages = newValue;
|
|
130
142
|
}
|
|
131
143
|
},
|
|
132
144
|
editPages(newValue, oldValue) {
|
|
133
145
|
if (newValue !== oldValue) {
|
|
134
|
-
this.$store.dispatch("edit/
|
|
146
|
+
this.$store.dispatch("edit/setPagesForPostprocess", newValue);
|
|
135
147
|
}
|
|
136
148
|
},
|
|
137
149
|
splitOverview(newValue) {
|
|
138
150
|
if (newValue) {
|
|
139
|
-
this.editPages = this.
|
|
151
|
+
this.editPages = this.pagesForPostprocess;
|
|
140
152
|
}
|
|
141
153
|
},
|
|
142
154
|
},
|
|
143
155
|
mounted() {
|
|
144
|
-
this.editPages = this.
|
|
156
|
+
this.editPages = this.pagesForPostprocess;
|
|
145
157
|
},
|
|
146
158
|
methods: {
|
|
147
159
|
handlePageChange(pageNumber) {
|
|
@@ -184,11 +196,10 @@ export default {
|
|
|
184
196
|
},
|
|
185
197
|
getRotation(pageId) {
|
|
186
198
|
// rotate page
|
|
187
|
-
return this.
|
|
188
|
-
?.angle;
|
|
199
|
+
return this.pagesForPostprocess?.find((p) => p.id === pageId)?.angle;
|
|
189
200
|
},
|
|
190
|
-
handleSplittingLines(page) {
|
|
191
|
-
this.$emit("handle-splitting-lines", page);
|
|
201
|
+
handleSplittingLines(page, origin) {
|
|
202
|
+
this.$emit("handle-splitting-lines", page, origin);
|
|
192
203
|
},
|
|
193
204
|
checkMove(event) {
|
|
194
205
|
this.$emit("check-move", event);
|