@konfuzio/document-validation-ui 0.1.14 → 0.1.16-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/README.md +12 -0
- package/cypress.config.js +13 -0
- 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 +3 -3
- package/dist/js/chunk-vendors.js.map +1 -1
- package/package.json +5 -1
- package/src/api.js +53 -23
- package/src/assets/images/DraggableIcon.vue +14 -0
- package/src/assets/images/GridIcon.vue +16 -0
- package/src/assets/images/MagicWandIcon.vue +16 -0
- package/src/assets/images/NotFoundIcon.vue +16 -0
- package/src/assets/images/ServerImage.vue +19 -9
- package/src/assets/images/SettingsIcon.vue +14 -0
- package/src/assets/images/SplitZigZag.vue +47 -14
- package/src/assets/images/StarIcon.vue +16 -0
- package/src/assets/scss/ann_set_table_options.scss +26 -0
- package/src/assets/scss/annotation_details.scss +86 -71
- package/src/assets/scss/choose_label_set_modal.scss +1 -1
- package/src/assets/scss/document_annotations.scss +242 -229
- package/src/assets/scss/document_category.scss +12 -7
- package/src/assets/scss/document_dashboard.scss +7 -2
- package/src/assets/scss/document_edit.scss +151 -173
- package/src/assets/scss/document_name.scss +0 -2
- package/src/assets/scss/document_thumbnails.scss +1 -1
- package/src/assets/scss/document_toolbar.scss +23 -1
- package/src/assets/scss/document_top_bar.scss +40 -1
- package/src/assets/scss/edit_page_thumbnail.scss +53 -0
- package/src/assets/scss/multi_ann_table_overlay.scss +38 -0
- package/src/assets/scss/new_annotation.scss +17 -3
- package/src/assets/scss/scrolling_document.scss +1 -1
- package/src/assets/scss/theme.scss +801 -0
- package/src/assets/scss/variables.scss +5 -663
- package/src/components/App.cy.js +7 -0
- package/src/components/App.vue +98 -11
- package/src/components/DocumentAnnotations/AnnotationActionButtons.vue +168 -0
- package/src/components/DocumentAnnotations/AnnotationContent.vue +50 -84
- package/src/components/DocumentAnnotations/AnnotationDetails.vue +37 -12
- package/src/components/DocumentAnnotations/AnnotationRow.vue +244 -199
- package/src/components/DocumentAnnotations/AnnotationSetActionButtons.vue +89 -0
- package/src/components/DocumentAnnotations/ChooseLabelSetModal.vue +4 -2
- package/src/components/DocumentAnnotations/DocumentAnnotations.cy.js +295 -0
- package/src/components/DocumentAnnotations/DocumentAnnotations.vue +195 -146
- package/src/components/DocumentAnnotations/DocumentLabel.vue +46 -9
- package/src/components/DocumentAnnotations/EmptyAnnotation.vue +59 -88
- package/src/components/DocumentAnnotations/ExtractingData.vue +18 -6
- package/src/components/DocumentAnnotations/MultiAnnotationTableOverlay.vue +337 -0
- package/src/components/DocumentAnnotations/index.js +1 -1
- package/src/components/DocumentCategory.vue +89 -65
- package/src/components/DocumentDashboard.vue +59 -48
- package/src/components/DocumentEdit/DocumentEdit.vue +302 -105
- package/src/components/DocumentEdit/EditConfirmationModal.vue +55 -0
- package/src/components/DocumentEdit/EditPageThumbnail.vue +114 -0
- package/src/components/DocumentEdit/EditPages.vue +60 -103
- package/src/components/DocumentEdit/EditSidebar.vue +101 -48
- package/src/components/DocumentEdit/{SplitOverview.vue → RenameAndCategorize.vue} +15 -13
- package/src/components/DocumentEdit/SidebarButtons.vue +53 -0
- package/src/components/DocumentEdit/SplitInfoBar.vue +21 -0
- package/src/components/DocumentEdit/index.js +1 -1
- package/src/components/{DocumentError.vue → DocumentModals/DocumentErrorModal.vue} +9 -8
- package/src/components/{NotOptimizedViewportModal.vue → DocumentModals/NotOptimizedViewportModal.vue} +2 -2
- package/src/components/DocumentPage/ActionBar.vue +3 -3
- package/src/components/DocumentPage/AnnSetTableOptions.vue +110 -0
- package/src/components/DocumentPage/BoxSelection.vue +4 -1
- package/src/components/DocumentPage/DocumentPage.vue +92 -68
- package/src/components/DocumentPage/DocumentToolbar.vue +105 -16
- package/src/components/DocumentPage/DummyPage.vue +9 -7
- package/src/components/DocumentPage/MultiAnnSelection.vue +96 -27
- package/src/components/DocumentPage/NewAnnotation.vue +31 -35
- package/src/components/DocumentPage/ScrollingDocument.vue +46 -5
- package/src/components/DocumentPage/ScrollingPage.vue +5 -6
- package/src/components/DocumentThumbnails/DocumentThumbnails.cy.js +64 -0
- package/src/components/DocumentThumbnails/DocumentThumbnails.vue +53 -13
- package/src/components/DocumentTopBar/DocumentName.vue +16 -4
- package/src/components/DocumentTopBar/DocumentTopBar.vue +86 -15
- package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +99 -72
- package/src/components/DocumentTopBar/KeyboardActionsDescription.vue +6 -3
- package/src/components/DocumentsList/DocumentsList.vue +6 -2
- package/src/components/index.js +1 -0
- package/src/constants.js +2 -1
- package/src/icons.js +45 -0
- package/src/locales/de.json +48 -21
- package/src/locales/en.json +37 -11
- package/src/locales/es.json +41 -13
- package/src/main.js +5 -66
- package/src/store/category.js +20 -36
- package/src/store/display.js +74 -1
- package/src/store/document.js +305 -109
- package/src/store/edit.js +160 -61
- package/src/store/project.js +46 -16
- package/src/store/selection.js +42 -10
- package/src/utils/utils.js +36 -0
- package/dist/css/chunk-vendors.css +0 -5
- package/src/.DS_Store +0 -0
- package/src/assets/scss/categorize_modal.scss +0 -45
- package/src/assets/scss/main.scss +0 -24
- package/src/components/DocumentAnnotations/ActionButtons.vue +0 -250
- package/src/components/DocumentAnnotations/CategorizeModal.vue +0 -219
- package/src/components/DocumentAnnotations/RejectedLabels.vue +0 -96
- package/src/components/DocumentPage/MultiAnnotationTablePopup.vue +0 -253
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="edit-page-thumbnail"
|
|
4
|
+
:tabindex="index"
|
|
5
|
+
@mouseenter="isHover = true"
|
|
6
|
+
@mouseleave="isHover = false"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
:class="[
|
|
10
|
+
'page-thumbnail',
|
|
11
|
+
isVisible && 'visible',
|
|
12
|
+
checkboxValue && 'selected',
|
|
13
|
+
]"
|
|
14
|
+
:style="`rotate:${rotation}deg`"
|
|
15
|
+
@click="selectPage()"
|
|
16
|
+
>
|
|
17
|
+
<ServerImage :image-url="`${page.thumbnail_url}?${page.updated_at}`">
|
|
18
|
+
<b-skeleton width="80px" height="80px" />
|
|
19
|
+
</ServerImage>
|
|
20
|
+
|
|
21
|
+
<div v-if="isVisible" class="action-icon">
|
|
22
|
+
<EyeIcon />
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<b-checkbox
|
|
26
|
+
v-show="isHover || checkboxValue"
|
|
27
|
+
v-model="checkboxValue"
|
|
28
|
+
class="action-checkbox"
|
|
29
|
+
@input="checkboxInput"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
import { mapGetters, mapState } from "vuex";
|
|
36
|
+
import ServerImage from "../../assets/images/ServerImage";
|
|
37
|
+
import EyeIcon from "../../assets/images/EyeIcon";
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
name: "EditPageThumbnail",
|
|
41
|
+
components: {
|
|
42
|
+
ServerImage,
|
|
43
|
+
EyeIcon,
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
page: {
|
|
47
|
+
required: true,
|
|
48
|
+
type: Object,
|
|
49
|
+
default: null,
|
|
50
|
+
},
|
|
51
|
+
index: {
|
|
52
|
+
required: true,
|
|
53
|
+
type: Number,
|
|
54
|
+
default: 0,
|
|
55
|
+
},
|
|
56
|
+
rotation: {
|
|
57
|
+
required: false,
|
|
58
|
+
type: Number,
|
|
59
|
+
default: 0,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
data() {
|
|
63
|
+
return {
|
|
64
|
+
isHover: false,
|
|
65
|
+
checkboxValue: false,
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
computed: {
|
|
69
|
+
...mapState("display", ["currentPage"]),
|
|
70
|
+
...mapState("edit", ["selectedPages"]),
|
|
71
|
+
...mapGetters("edit", ["isPageSelected"]),
|
|
72
|
+
isVisible() {
|
|
73
|
+
return this.currentPage === this.page.number;
|
|
74
|
+
},
|
|
75
|
+
isSelected() {
|
|
76
|
+
return this.isPageSelected(this.page.id) !== undefined;
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
watch: {
|
|
80
|
+
isSelected() {
|
|
81
|
+
this.checkboxValue = this.isSelected;
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
mounted() {
|
|
85
|
+
this.checkboxValue = this.isSelected;
|
|
86
|
+
},
|
|
87
|
+
methods: {
|
|
88
|
+
selectPage(value = !this.isSelected) {
|
|
89
|
+
this.changePage();
|
|
90
|
+
this.$store.dispatch(
|
|
91
|
+
value ? "edit/selectPage" : "edit/unselectPage",
|
|
92
|
+
this.page
|
|
93
|
+
);
|
|
94
|
+
},
|
|
95
|
+
checkboxInput(value) {
|
|
96
|
+
this.selectPage(value);
|
|
97
|
+
},
|
|
98
|
+
changePage() {
|
|
99
|
+
if (!this.isVisible) {
|
|
100
|
+
this.$store.dispatch(
|
|
101
|
+
"display/updateCurrentPage",
|
|
102
|
+
parseInt(this.page.number, 10)
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
</script>
|
|
109
|
+
|
|
110
|
+
<style
|
|
111
|
+
scoped
|
|
112
|
+
lang="scss"
|
|
113
|
+
src="../../assets/scss/edit_page_thumbnail.scss"
|
|
114
|
+
></style>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="edit-pages">
|
|
3
|
+
<div class="grid-header">
|
|
4
|
+
<span class="header-title">{{ $t("rotate_split_reorder") }}</span>
|
|
5
|
+
</div>
|
|
3
6
|
<draggable
|
|
4
7
|
v-model="editPages"
|
|
5
8
|
class="document-grid"
|
|
@@ -13,62 +16,49 @@
|
|
|
13
16
|
:key="page.id"
|
|
14
17
|
class="image-section"
|
|
15
18
|
tabindex="0"
|
|
16
|
-
@focusout="clickOutside"
|
|
17
19
|
>
|
|
18
|
-
<div
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
<div class="top-section">
|
|
21
|
+
<EditPageThumbnail
|
|
22
|
+
:page="page"
|
|
23
|
+
:index="index"
|
|
24
|
+
:rotation="getRotation(page.id)"
|
|
25
|
+
/>
|
|
26
|
+
<div
|
|
27
|
+
:class="[
|
|
28
|
+
'splitting-lines',
|
|
29
|
+
splittingLines &&
|
|
30
|
+
splittingLines[index].page === page.number &&
|
|
31
|
+
'active-split',
|
|
32
|
+
]"
|
|
33
|
+
@click="handleSplittingLines(page.number, 'manual')"
|
|
34
|
+
>
|
|
35
|
+
<div class="scissors-icon">
|
|
36
|
+
<b-icon icon="scissors" class="is-small" />
|
|
37
|
+
</div>
|
|
24
38
|
<div
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
v-if="
|
|
40
|
+
splittingLines && splittingLines[index].page === page.number
|
|
41
|
+
"
|
|
42
|
+
class="lines"
|
|
29
43
|
>
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
<SplitZigZag
|
|
45
|
+
:color="
|
|
46
|
+
splittingLines &&
|
|
47
|
+
splittingLines[index].origin &&
|
|
48
|
+
splittingLines[index].origin === 'AI' &&
|
|
49
|
+
splitSuggestionsEnabled
|
|
50
|
+
? 'green'
|
|
51
|
+
: 'dark'
|
|
52
|
+
"
|
|
53
|
+
/>
|
|
39
54
|
</div>
|
|
40
|
-
<div class="
|
|
41
|
-
<
|
|
42
|
-
<EyeIcon />
|
|
43
|
-
</div>
|
|
55
|
+
<div v-else class="lines">
|
|
56
|
+
<SplitLines />
|
|
44
57
|
</div>
|
|
45
58
|
</div>
|
|
46
|
-
<span class="page-number">{{ page.number }}</span>
|
|
47
59
|
</div>
|
|
48
|
-
<div
|
|
49
|
-
|
|
50
|
-
'splitting-lines',
|
|
51
|
-
activeSplittingLines &&
|
|
52
|
-
activeSplittingLines[index] === page.number &&
|
|
53
|
-
'active-split',
|
|
54
|
-
]"
|
|
55
|
-
@click="handleSplittingLines(page)"
|
|
56
|
-
>
|
|
57
|
-
<div class="scissors-icon">
|
|
58
|
-
<b-icon icon="scissors" class="is-small" />
|
|
59
|
-
</div>
|
|
60
|
-
<div
|
|
61
|
-
v-if="
|
|
62
|
-
activeSplittingLines &&
|
|
63
|
-
activeSplittingLines[index] === page.number
|
|
64
|
-
"
|
|
65
|
-
class="lines"
|
|
66
|
-
>
|
|
67
|
-
<SplitZigZag />
|
|
68
|
-
</div>
|
|
69
|
-
<div v-else class="lines">
|
|
70
|
-
<SplitLines />
|
|
71
|
-
</div>
|
|
60
|
+
<div class="bottom-section">
|
|
61
|
+
<span class="page-number">{{ page.number }}</span>
|
|
72
62
|
</div>
|
|
73
63
|
</div>
|
|
74
64
|
</draggable>
|
|
@@ -82,112 +72,79 @@
|
|
|
82
72
|
*/
|
|
83
73
|
|
|
84
74
|
import { mapState } from "vuex";
|
|
85
|
-
import ServerImage from "../../assets/images/ServerImage";
|
|
86
75
|
import SplitLines from "../../assets/images/SplitLines";
|
|
87
76
|
import SplitZigZag from "../../assets/images/SplitZigZag";
|
|
88
|
-
import
|
|
77
|
+
import EditPageThumbnail from "./EditPageThumbnail";
|
|
78
|
+
|
|
89
79
|
import draggable from "vuedraggable";
|
|
90
80
|
|
|
91
81
|
export default {
|
|
92
82
|
name: "EditPages",
|
|
93
83
|
components: {
|
|
94
|
-
ServerImage,
|
|
95
84
|
SplitLines,
|
|
96
85
|
SplitZigZag,
|
|
97
|
-
|
|
86
|
+
EditPageThumbnail,
|
|
98
87
|
draggable,
|
|
99
88
|
},
|
|
100
89
|
props: {
|
|
101
|
-
|
|
90
|
+
splittingLines: {
|
|
102
91
|
type: Array,
|
|
92
|
+
default: null,
|
|
93
|
+
},
|
|
94
|
+
splitSuggestionsEnabled: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false,
|
|
103
97
|
},
|
|
104
98
|
},
|
|
105
99
|
data() {
|
|
106
100
|
return {
|
|
107
101
|
editPages: null,
|
|
108
|
-
selected: null,
|
|
109
102
|
};
|
|
110
103
|
},
|
|
104
|
+
|
|
111
105
|
computed: {
|
|
112
106
|
...mapState("document", [
|
|
113
107
|
"pages",
|
|
114
108
|
"recalculatingAnnotations",
|
|
115
109
|
"selectedDocument",
|
|
110
|
+
"splittingSuggestions",
|
|
116
111
|
]),
|
|
117
112
|
...mapState("edit", [
|
|
118
113
|
"editMode",
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"selectedPages",
|
|
122
|
-
"splitOverview",
|
|
114
|
+
"pagesForPostprocess",
|
|
115
|
+
"renameAndCategorize",
|
|
123
116
|
]),
|
|
124
117
|
},
|
|
125
118
|
watch: {
|
|
126
|
-
|
|
119
|
+
pagesForPostprocess(newValue, oldValue) {
|
|
127
120
|
if (newValue !== oldValue) {
|
|
128
121
|
this.editPages = newValue;
|
|
129
122
|
}
|
|
130
123
|
},
|
|
131
124
|
editPages(newValue, oldValue) {
|
|
132
125
|
if (newValue !== oldValue) {
|
|
133
|
-
this.$store.dispatch("edit/
|
|
126
|
+
this.$store.dispatch("edit/setPagesForPostprocess", newValue);
|
|
134
127
|
}
|
|
135
128
|
},
|
|
136
|
-
|
|
129
|
+
renameAndCategorize(newValue) {
|
|
137
130
|
if (newValue) {
|
|
138
|
-
this.editPages = this.
|
|
131
|
+
this.editPages = this.pagesForPostprocess;
|
|
139
132
|
}
|
|
140
133
|
},
|
|
141
134
|
},
|
|
142
135
|
mounted() {
|
|
143
|
-
this.editPages = this.
|
|
136
|
+
this.editPages = this.pagesForPostprocess;
|
|
144
137
|
},
|
|
145
138
|
methods: {
|
|
146
|
-
handlePageChange(pageNumber) {
|
|
147
|
-
this.$emit("change-page", pageNumber);
|
|
148
|
-
},
|
|
149
|
-
isPageSelected(id) {
|
|
150
|
-
if (this.selectedPages.length === 0) return;
|
|
151
|
-
const selectedPage = this.selectedPages.find((page) => page.id === id);
|
|
152
|
-
if (selectedPage) return selectedPage.id;
|
|
153
|
-
},
|
|
154
|
-
selectPage(page) {
|
|
155
|
-
if (!page) return;
|
|
156
|
-
this.$emit("change-page", page.number);
|
|
157
|
-
const selectedPage = {
|
|
158
|
-
id: page.id,
|
|
159
|
-
number: page.number,
|
|
160
|
-
thumbnail_url: page.thumbnail_url,
|
|
161
|
-
};
|
|
162
|
-
this.selected = true;
|
|
163
|
-
|
|
164
|
-
this.$store.dispatch("edit/setSelectedPages", selectedPage);
|
|
165
|
-
},
|
|
166
|
-
clickOutside(event) {
|
|
167
|
-
if (!event || this.selectedPages.length === 0) return;
|
|
168
|
-
|
|
169
|
-
// Check if user clicks in any element other than thumbnail or buttons to deselect the thumbnail
|
|
170
|
-
if (
|
|
171
|
-
event.target.className.includes("button") ||
|
|
172
|
-
event.target.className.includes("image-container") ||
|
|
173
|
-
event.target.className.includes("icon")
|
|
174
|
-
) {
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
this.deselect();
|
|
179
|
-
},
|
|
180
139
|
deselect() {
|
|
181
|
-
this.selected = null;
|
|
182
140
|
this.$store.dispatch("edit/setSelectedPages");
|
|
183
141
|
},
|
|
184
142
|
getRotation(pageId) {
|
|
185
143
|
// rotate page
|
|
186
|
-
return this.
|
|
187
|
-
?.angle;
|
|
144
|
+
return this.pagesForPostprocess?.find((p) => p.id === pageId)?.angle;
|
|
188
145
|
},
|
|
189
|
-
handleSplittingLines(page) {
|
|
190
|
-
this.$emit("handle-splitting-lines", page);
|
|
146
|
+
handleSplittingLines(page, origin) {
|
|
147
|
+
this.$emit("handle-splitting-lines", page, origin);
|
|
191
148
|
},
|
|
192
149
|
checkMove(event) {
|
|
193
150
|
this.$emit("check-move", event);
|
|
@@ -1,75 +1,105 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="edit-sidebar">
|
|
3
|
-
<div class="sidebar-header">
|
|
4
|
-
<h3 class="sidebar-title">
|
|
5
|
-
{{ $t("edit_document") }}
|
|
6
|
-
</h3>
|
|
7
|
-
<p class="description">
|
|
8
|
-
{{ $t("edit_early_access") }}
|
|
9
|
-
</p>
|
|
10
|
-
<p class="description">
|
|
11
|
-
{{ $t("select_pages") }}
|
|
12
|
-
</p>
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
3
|
<div class="buttons-container">
|
|
16
|
-
<div class="rotate-selected
|
|
4
|
+
<div class="rotate-selected edit-buttons">
|
|
5
|
+
<SidebarButtons
|
|
6
|
+
:show-rotate-button="true"
|
|
7
|
+
:button-disabled="buttonDisabled"
|
|
8
|
+
:button-text="$t('rotate_selected')"
|
|
9
|
+
:icon="'arrow-rotate-left'"
|
|
10
|
+
@rotate="rotateLeft"
|
|
11
|
+
/>
|
|
12
|
+
|
|
13
|
+
<SidebarButtons
|
|
14
|
+
:show-rotate-button="true"
|
|
15
|
+
:button-disabled="buttonDisabled"
|
|
16
|
+
:button-text="$t('rotate_selected')"
|
|
17
|
+
:icon="'arrow-rotate-right'"
|
|
18
|
+
@rotate="rotateRight"
|
|
19
|
+
/>
|
|
20
|
+
|
|
17
21
|
<p :class="['pages-selected', buttonDisabled && 'disabled']">
|
|
18
22
|
{{ selectedPages.length }} {{ $t("selected") }}
|
|
19
23
|
</p>
|
|
20
|
-
<b-button
|
|
21
|
-
class="rotate-button primary-button"
|
|
22
|
-
:disabled="buttonDisabled"
|
|
23
|
-
@click="rotateLeft"
|
|
24
|
-
>
|
|
25
|
-
<div class="button-content">
|
|
26
|
-
<b-icon icon="arrow-rotate-left" class="is-small" />
|
|
27
|
-
<span class="button-text">{{ $t("rotate_selected") }}</span>
|
|
28
|
-
</div>
|
|
29
|
-
</b-button>
|
|
30
|
-
<b-button
|
|
31
|
-
class="rotate-button primary-button"
|
|
32
|
-
:disabled="buttonDisabled"
|
|
33
|
-
@click="rotateRight"
|
|
34
|
-
>
|
|
35
|
-
<div class="button-content">
|
|
36
|
-
<b-icon icon="arrow-rotate-right" class="is-small" />
|
|
37
|
-
<span class="button-text">{{ $t("rotate_selected") }}</span>
|
|
38
|
-
</div>
|
|
39
|
-
</b-button>
|
|
40
24
|
</div>
|
|
41
25
|
|
|
42
|
-
<div class="rotate-all
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
26
|
+
<div class="rotate-all edit-buttons">
|
|
27
|
+
<SidebarButtons
|
|
28
|
+
:show-rotate-button="true"
|
|
29
|
+
:button-disabled="false"
|
|
30
|
+
:button-text="$t('rotate_all')"
|
|
31
|
+
:icon="'arrow-rotate-left'"
|
|
32
|
+
@rotate="rotateAllLeft"
|
|
33
|
+
/>
|
|
34
|
+
|
|
35
|
+
<SidebarButtons
|
|
36
|
+
:show-rotate-button="true"
|
|
37
|
+
:button-disabled="false"
|
|
38
|
+
:button-text="$t('rotate_all')"
|
|
39
|
+
:icon="'arrow-rotate-right'"
|
|
40
|
+
@rotate="rotateAllRight"
|
|
41
|
+
/>
|
|
51
42
|
</div>
|
|
52
43
|
</div>
|
|
44
|
+
<div class="split smart-split">
|
|
45
|
+
<b-tooltip
|
|
46
|
+
multilined
|
|
47
|
+
:active="!documentHasProposedSplit(selectedDocument)"
|
|
48
|
+
position="is-bottom"
|
|
49
|
+
class="bottom-aligned"
|
|
50
|
+
:label="tooltipInfo"
|
|
51
|
+
>
|
|
52
|
+
<b-field>
|
|
53
|
+
<b-switch
|
|
54
|
+
v-model="switchStatus"
|
|
55
|
+
:value="true"
|
|
56
|
+
size="is-small"
|
|
57
|
+
:disabled="!documentHasProposedSplit(selectedDocument)"
|
|
58
|
+
/>
|
|
59
|
+
<div class="switch-info">
|
|
60
|
+
<span class="switch-text">{{ $t("smart_split") }}</span>
|
|
61
|
+
<span
|
|
62
|
+
v-if="documentHasProposedSplit(selectedDocument)"
|
|
63
|
+
class="new-badge"
|
|
64
|
+
>{{ newText }}</span
|
|
65
|
+
>
|
|
66
|
+
</div>
|
|
67
|
+
</b-field>
|
|
68
|
+
</b-tooltip>
|
|
69
|
+
</div>
|
|
53
70
|
</div>
|
|
54
71
|
</template>
|
|
55
72
|
|
|
56
73
|
<script>
|
|
74
|
+
import { mapState, mapGetters } from "vuex";
|
|
75
|
+
import SidebarButtons from "./SidebarButtons";
|
|
76
|
+
|
|
57
77
|
/**
|
|
58
78
|
* This component renders buttons to rotate single pages or all pages
|
|
59
79
|
* in edit mode
|
|
60
80
|
* */
|
|
61
|
-
|
|
62
|
-
import { mapState } from "vuex";
|
|
63
|
-
|
|
64
81
|
export default {
|
|
65
82
|
name: "EditSidebar",
|
|
83
|
+
components: {
|
|
84
|
+
SidebarButtons,
|
|
85
|
+
},
|
|
86
|
+
props: {
|
|
87
|
+
splitSuggestionsEnabled: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
66
91
|
data() {
|
|
67
92
|
return {
|
|
68
93
|
buttonDisabled: true,
|
|
94
|
+
tooltipInfo: null,
|
|
95
|
+
newText: this.$t("new"),
|
|
96
|
+
switchStatus: true,
|
|
69
97
|
};
|
|
70
98
|
},
|
|
71
99
|
computed: {
|
|
72
|
-
...mapState("edit", ["selectedPages"]),
|
|
100
|
+
...mapState("edit", ["selectedPages", "updatedDocument"]),
|
|
101
|
+
...mapState("document", ["splittingSuggestions", "selectedDocument"]),
|
|
102
|
+
...mapGetters("document", ["documentHasProposedSplit"]),
|
|
73
103
|
},
|
|
74
104
|
watch: {
|
|
75
105
|
selectedPages(newValue) {
|
|
@@ -79,13 +109,36 @@ export default {
|
|
|
79
109
|
this.buttonDisabled = true;
|
|
80
110
|
}
|
|
81
111
|
},
|
|
112
|
+
switchStatus(newValue) {
|
|
113
|
+
if (this.splittingSuggestions && this.splittingSuggestions.length > 0)
|
|
114
|
+
this.$emit("handle-splitting-suggestions", newValue);
|
|
115
|
+
},
|
|
116
|
+
splitSuggestionsEnabled(newValue) {
|
|
117
|
+
if (!newValue) {
|
|
118
|
+
this.switchStatus = false;
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
updatedDocument(newValue) {
|
|
122
|
+
if (newValue && newValue.length === 1) {
|
|
123
|
+
this.switchStatus = false;
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
mounted() {
|
|
128
|
+
this.$nextTick(() => {
|
|
129
|
+
this.switchStatus = this.splitSuggestionsEnabled;
|
|
130
|
+
this.tooltipInfo = this.$t("no_splitting_suggestions");
|
|
131
|
+
if (this.newText) {
|
|
132
|
+
this.newText = this.$t("new").toUpperCase();
|
|
133
|
+
}
|
|
134
|
+
});
|
|
82
135
|
},
|
|
83
136
|
methods: {
|
|
84
137
|
rotateLeft() {
|
|
85
|
-
this.$emit("rotate
|
|
138
|
+
this.$emit("rotate", "left");
|
|
86
139
|
},
|
|
87
140
|
rotateRight() {
|
|
88
|
-
this.$emit("rotate
|
|
141
|
+
this.$emit("rotate", "right");
|
|
89
142
|
},
|
|
90
143
|
rotateAllLeft() {
|
|
91
144
|
this.$emit("rotate-all-left");
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="rename-and-categorize">
|
|
3
3
|
<div class="back-section" @click="handleBackButton">
|
|
4
4
|
<div class="back-btn-section">
|
|
5
5
|
<b-icon
|
|
6
6
|
icon="arrow-left"
|
|
7
7
|
class="is-small arrow"
|
|
8
|
-
:style="{ color: '#
|
|
8
|
+
:style="{ color: '#1a1a1a', cursor: 'pointer' }"
|
|
9
9
|
/>
|
|
10
10
|
</div>
|
|
11
11
|
<div class="back-text">
|
|
12
|
-
{{ $t("
|
|
12
|
+
{{ $t("rotate_split_reorder") }}
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
|
-
<div class="
|
|
16
|
-
{{ $t("
|
|
15
|
+
<div class="rename-and-categorize-title">
|
|
16
|
+
{{ $t("rename_and_categorize") }}
|
|
17
17
|
</div>
|
|
18
18
|
<div class="new-documents-container">
|
|
19
19
|
<div
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
:key="index"
|
|
22
22
|
class="document-details"
|
|
23
23
|
>
|
|
24
|
-
<div class="
|
|
24
|
+
<div class="rename-and-categorize-thumbnails">
|
|
25
25
|
<div class="split-documents">
|
|
26
26
|
<div
|
|
27
27
|
class="image-container"
|
|
@@ -88,7 +88,7 @@ import ServerImage from "../../assets/images/ServerImage";
|
|
|
88
88
|
import EyeIcon from "../../assets/images/EyeIcon";
|
|
89
89
|
|
|
90
90
|
export default {
|
|
91
|
-
name: "
|
|
91
|
+
name: "RenameAndCategorize",
|
|
92
92
|
components: {
|
|
93
93
|
DocumentCategory,
|
|
94
94
|
ServerImage,
|
|
@@ -97,9 +97,11 @@ export default {
|
|
|
97
97
|
props: {
|
|
98
98
|
fileName: {
|
|
99
99
|
type: String,
|
|
100
|
+
default: "",
|
|
100
101
|
},
|
|
101
102
|
fileExtension: {
|
|
102
103
|
type: String,
|
|
104
|
+
default: "",
|
|
103
105
|
},
|
|
104
106
|
},
|
|
105
107
|
data() {
|
|
@@ -110,11 +112,12 @@ export default {
|
|
|
110
112
|
},
|
|
111
113
|
computed: {
|
|
112
114
|
...mapState("document", ["selectedDocument", "pages"]),
|
|
113
|
-
...mapState("edit", ["updatedDocument", "
|
|
115
|
+
...mapState("edit", ["updatedDocument", "pagesForPostprocess"]),
|
|
114
116
|
},
|
|
117
|
+
|
|
115
118
|
methods: {
|
|
116
119
|
handleBackButton() {
|
|
117
|
-
this.$store.dispatch("edit/
|
|
120
|
+
this.$store.dispatch("edit/setRenameAndCategorize", false);
|
|
118
121
|
},
|
|
119
122
|
handlePaste(event) {
|
|
120
123
|
// TODO: modify to only paste plain text
|
|
@@ -160,11 +163,11 @@ export default {
|
|
|
160
163
|
return name.split(".").slice(0, -1).join(".");
|
|
161
164
|
},
|
|
162
165
|
getImageUrl(page) {
|
|
163
|
-
if (!this.
|
|
166
|
+
if (!this.pagesForPostprocess || !this.pages || !page) return;
|
|
164
167
|
|
|
165
168
|
// returns the first thumbnail in the pages array
|
|
166
169
|
// for each new document
|
|
167
|
-
const image = this.
|
|
170
|
+
const image = this.pagesForPostprocess.find(
|
|
168
171
|
(p) => p.number === page.pages[0].number
|
|
169
172
|
);
|
|
170
173
|
|
|
@@ -172,8 +175,7 @@ export default {
|
|
|
172
175
|
},
|
|
173
176
|
getRotation(pageId) {
|
|
174
177
|
// rotate page
|
|
175
|
-
return this.
|
|
176
|
-
?.angle;
|
|
178
|
+
return this.pagesForPostprocess?.find((p) => p.id === pageId)?.angle;
|
|
177
179
|
},
|
|
178
180
|
},
|
|
179
181
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sidebar-buttons">
|
|
3
|
+
<!-- Rotate buttons -->
|
|
4
|
+
<div v-if="showRotateButton" class="rotate-button-container">
|
|
5
|
+
<b-button
|
|
6
|
+
class="rotate-button edit-mode-btn primary-button"
|
|
7
|
+
:disabled="buttonDisabled"
|
|
8
|
+
@click="rotateButton"
|
|
9
|
+
>
|
|
10
|
+
<div class="button-content">
|
|
11
|
+
<b-icon :icon="icon" class="is-small" />
|
|
12
|
+
<span class="button-text">{{ buttonText }}</span>
|
|
13
|
+
</div>
|
|
14
|
+
</b-button>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
name: "SidebarButtons",
|
|
22
|
+
props: {
|
|
23
|
+
showRotateButton: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false,
|
|
26
|
+
},
|
|
27
|
+
buttonDisabled: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true,
|
|
30
|
+
},
|
|
31
|
+
buttonText: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: null,
|
|
34
|
+
},
|
|
35
|
+
icon: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: null,
|
|
38
|
+
},
|
|
39
|
+
tooltipInfo: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: null,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
methods: {
|
|
46
|
+
rotateButton() {
|
|
47
|
+
this.$emit("rotate");
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<style scoped lang="scss" src="../../assets/scss/document_edit.scss"></style>
|