@konfuzio/document-validation-ui 0.1.19 → 0.1.20-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/.eslintrc.js +10 -10
- package/.prettierrc.json +1 -1
- package/LICENSE +21 -21
- package/README.md +24 -24
- package/cypress.config.js +13 -13
- package/dist/js/app.js +1 -1
- package/dist/js/app.js.map +1 -1
- package/dist/js/chunk-vendors.js +1 -1
- package/dist/js/chunk-vendors.js.map +1 -1
- package/jest.config.js +4 -4
- package/package.json +66 -66
- package/src/api.js +82 -82
- package/src/assets/images/AcceptedCheckMark.vue +8 -8
- package/src/assets/images/AcceptedUser.vue +8 -8
- package/src/assets/images/ActionIcon.vue +60 -60
- package/src/assets/images/ArrowDownKey.vue +11 -11
- package/src/assets/images/ArrowUpKey.vue +11 -11
- package/src/assets/images/CategoryIconImg.vue +13 -13
- package/src/assets/images/CheckMark.vue +8 -8
- package/src/assets/images/DraggableIcon.vue +14 -14
- package/src/assets/images/EditDocIcon.vue +12 -12
- package/src/assets/images/EmptyStateImg.vue +129 -129
- package/src/assets/images/ErrorIcon.vue +28 -28
- package/src/assets/images/EyeIcon.vue +11 -11
- package/src/assets/images/FileNameNotSavedImage.vue +26 -26
- package/src/assets/images/FileNameSavedImage.vue +14 -14
- package/src/assets/images/FitZoomIcon.vue +16 -16
- package/src/assets/images/GridIcon.vue +16 -16
- package/src/assets/images/KeyboardIcon.vue +16 -16
- package/src/assets/images/MagicWandIcon.vue +16 -16
- package/src/assets/images/MinusIcon.vue +13 -13
- package/src/assets/images/NotFoundIcon.vue +16 -16
- package/src/assets/images/NotOptimizedIllustration.vue +651 -651
- package/src/assets/images/PlusIcon.vue +13 -13
- package/src/assets/images/QuestionMark.vue +12 -12
- package/src/assets/images/ServerImage.vue +73 -73
- package/src/assets/images/SettingsIcon.vue +14 -14
- package/src/assets/images/SplitLines.vue +18 -18
- package/src/assets/images/SplitZigZag.vue +49 -49
- package/src/assets/images/StarIcon.vue +16 -16
- package/src/assets/images/StatusImg.vue +14 -14
- package/src/assets/images/TranslateArrows.vue +33 -33
- package/src/assets/scss/ann_set_table_options.scss +26 -26
- package/src/assets/scss/annotation_details.scss +141 -141
- package/src/assets/scss/choose_label_set_modal.scss +65 -65
- package/src/assets/scss/document_action_bar.scss +37 -37
- package/src/assets/scss/document_annotations.scss +558 -558
- package/src/assets/scss/document_category.scss +85 -85
- package/src/assets/scss/document_dashboard.scss +52 -52
- package/src/assets/scss/document_edit.scss +410 -410
- package/src/assets/scss/document_error.scss +81 -81
- package/src/assets/scss/document_name.scss +60 -60
- package/src/assets/scss/document_page.scss +12 -12
- package/src/assets/scss/document_thumbnails.scss +41 -41
- package/src/assets/scss/document_toolbar.scss +111 -111
- package/src/assets/scss/document_top_bar.scss +171 -171
- package/src/assets/scss/document_viewport_modal.scss +25 -25
- package/src/assets/scss/documents_list.scss +141 -141
- package/src/assets/scss/edit_page_thumbnail.scss +53 -53
- package/src/assets/scss/empty_state.scss +34 -34
- package/src/assets/scss/extracting_data.scss +35 -35
- package/src/assets/scss/imports.scss +1 -1
- package/src/assets/scss/multi_ann_table_overlay.scss +38 -38
- package/src/assets/scss/multi_ann_table_popup.scss +12 -12
- package/src/assets/scss/new_annotation.scss +102 -102
- package/src/assets/scss/scrolling_document.scss +19 -19
- package/src/assets/scss/theme.scss +801 -801
- package/src/assets/scss/variables.scss +66 -66
- package/src/components/App.cy.js +7 -7
- package/src/components/App.vue +187 -187
- package/src/components/DocumentAnnotations/AnnotationActionButtons.vue +152 -152
- package/src/components/DocumentAnnotations/AnnotationContent.vue +210 -210
- package/src/components/DocumentAnnotations/AnnotationDetails.vue +251 -251
- package/src/components/DocumentAnnotations/AnnotationRow.vue +752 -752
- package/src/components/DocumentAnnotations/AnnotationSetActionButtons.vue +89 -89
- package/src/components/DocumentAnnotations/ChooseLabelSetModal.vue +186 -186
- package/src/components/DocumentAnnotations/DocumentAnnotations.cy.js +441 -441
- package/src/components/DocumentAnnotations/DocumentAnnotations.vue +534 -534
- package/src/components/DocumentAnnotations/DocumentLabel.vue +189 -189
- package/src/components/DocumentAnnotations/EmptyAnnotation.vue +193 -193
- package/src/components/DocumentAnnotations/EmptyState.vue +21 -21
- package/src/components/DocumentAnnotations/ExtractingData.vue +41 -41
- package/src/components/DocumentAnnotations/LoadingAnnotations.vue +43 -43
- package/src/components/DocumentAnnotations/LoadingLabels.vue +43 -43
- package/src/components/DocumentAnnotations/MultiAnnotationTableOverlay.vue +338 -338
- package/src/components/DocumentAnnotations/index.js +8 -8
- package/src/components/DocumentCategory.vue +281 -281
- package/src/components/DocumentDashboard.vue +170 -170
- package/src/components/DocumentEdit/DocumentEdit.cy.js +541 -541
- package/src/components/DocumentEdit/DocumentEdit.vue +503 -503
- package/src/components/DocumentEdit/EditConfirmationModal.vue +55 -55
- package/src/components/DocumentEdit/EditPageThumbnail.vue +114 -114
- package/src/components/DocumentEdit/EditPages.vue +161 -161
- package/src/components/DocumentEdit/EditSidebar.vue +154 -154
- package/src/components/DocumentEdit/RenameAndCategorize.vue +184 -184
- package/src/components/DocumentEdit/SidebarButtons.vue +53 -53
- package/src/components/DocumentEdit/SplitInfoBar.vue +21 -21
- package/src/components/DocumentEdit/index.js +4 -4
- package/src/components/DocumentModals/DocumentErrorModal.vue +58 -58
- package/src/components/DocumentModals/NotOptimizedViewportModal.vue +51 -51
- package/src/components/DocumentPage/ActionBar.vue +48 -48
- package/src/components/DocumentPage/AnnSetTableOptions.vue +111 -111
- package/src/components/DocumentPage/BoxSelection.vue +152 -152
- package/src/components/DocumentPage/DocumentPage.cy.js +92 -92
- package/src/components/DocumentPage/DocumentPage.vue +568 -568
- package/src/components/DocumentPage/DocumentToolbar.cy.js +215 -215
- package/src/components/DocumentPage/DocumentToolbar.vue +228 -228
- package/src/components/DocumentPage/DummyPage.vue +55 -55
- package/src/components/DocumentPage/MultiAnnSelection.vue +371 -371
- package/src/components/DocumentPage/NewAnnotation.vue +308 -308
- package/src/components/DocumentPage/ScrollingDocument.vue +149 -149
- package/src/components/DocumentPage/ScrollingPage.vue +179 -179
- package/src/components/DocumentPage/index.js +5 -5
- package/src/components/DocumentThumbnails/DocumentThumbnails.cy.js +67 -67
- package/src/components/DocumentThumbnails/DocumentThumbnails.vue +132 -132
- package/src/components/DocumentThumbnails/LoadingThumbnail.vue +25 -25
- package/src/components/DocumentThumbnails/index.js +1 -1
- package/src/components/DocumentTopBar/DocumentName.vue +236 -236
- package/src/components/DocumentTopBar/DocumentTopBar.cy.js +222 -222
- package/src/components/DocumentTopBar/DocumentTopBar.vue +202 -202
- package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +183 -183
- package/src/components/DocumentTopBar/KeyboardActionsDescription.vue +74 -74
- package/src/components/DocumentTopBar/index.js +3 -3
- package/src/components/DocumentsList/DocumentsList.vue +121 -121
- package/src/components/DocumentsList/index.js +1 -1
- package/src/components/ErrorMessage.vue +40 -40
- package/src/components/index.js +1 -1
- package/src/constants.js +5 -5
- package/src/directives/scroll.js +28 -28
- package/src/i18n.js +22 -22
- package/src/icons.js +45 -45
- package/src/locales/de.json +148 -148
- package/src/locales/en.json +148 -148
- package/src/main.js +26 -26
- package/src/store/category.js +191 -191
- package/src/store/display.js +311 -311
- package/src/store/document.js +1438 -1438
- package/src/store/edit.js +316 -316
- package/src/store/index.js +21 -21
- package/src/store/project.js +143 -143
- package/src/store/selection.js +210 -210
- package/src/utils/utils.js +54 -54
- package/vue.config.js +25 -25
|
@@ -1,55 +1,55 @@
|
|
|
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
|
-
this.isModalActive = false;
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<style scoped lang="scss" src="../../assets/scss/document_edit.scss"></style>
|
|
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
|
+
this.isModalActive = false;
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<style scoped lang="scss" src="../../assets/scss/document_edit.scss"></style>
|
|
@@ -1,114 +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
|
+
<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,161 +1,161 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="edit-pages">
|
|
3
|
-
<div class="grid-header">
|
|
4
|
-
<span class="header-title">{{ $t("rotate_split_reorder") }}</span>
|
|
5
|
-
</div>
|
|
6
|
-
<draggable
|
|
7
|
-
v-model="editPages"
|
|
8
|
-
class="document-grid"
|
|
9
|
-
easing="cubic-bezier(0.37, 0, 0.63, 1)"
|
|
10
|
-
@start="dragging = true"
|
|
11
|
-
@end="handleDragEnd"
|
|
12
|
-
@move="checkMove"
|
|
13
|
-
>
|
|
14
|
-
<div
|
|
15
|
-
v-for="(page, index) in editPages"
|
|
16
|
-
:key="page.id"
|
|
17
|
-
class="image-section"
|
|
18
|
-
tabindex="0"
|
|
19
|
-
>
|
|
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>
|
|
38
|
-
<div
|
|
39
|
-
v-if="
|
|
40
|
-
splittingLines && splittingLines[index].page === page.number
|
|
41
|
-
"
|
|
42
|
-
class="lines active-split"
|
|
43
|
-
>
|
|
44
|
-
<SplitZigZag
|
|
45
|
-
:color="
|
|
46
|
-
splittingLines &&
|
|
47
|
-
splittingLines[index].origin &&
|
|
48
|
-
splittingLines[index].origin === 'AI' &&
|
|
49
|
-
splitSuggestionsEnabled
|
|
50
|
-
? 'green'
|
|
51
|
-
: 'dark'
|
|
52
|
-
"
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
<div v-else class="lines not-active-split">
|
|
56
|
-
<SplitLines />
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
<div class="bottom-section">
|
|
61
|
-
<span class="page-number">{{ page.number }}</span>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</draggable>
|
|
65
|
-
</div>
|
|
66
|
-
</template>
|
|
67
|
-
|
|
68
|
-
<script>
|
|
69
|
-
/**
|
|
70
|
-
* This component renders a grid of the document pages
|
|
71
|
-
* that will be possible to resort, split and/or rotate
|
|
72
|
-
*/
|
|
73
|
-
|
|
74
|
-
import { mapState } from "vuex";
|
|
75
|
-
import SplitLines from "../../assets/images/SplitLines";
|
|
76
|
-
import SplitZigZag from "../../assets/images/SplitZigZag";
|
|
77
|
-
import EditPageThumbnail from "./EditPageThumbnail";
|
|
78
|
-
|
|
79
|
-
import draggable from "vuedraggable";
|
|
80
|
-
|
|
81
|
-
export default {
|
|
82
|
-
name: "EditPages",
|
|
83
|
-
components: {
|
|
84
|
-
SplitLines,
|
|
85
|
-
SplitZigZag,
|
|
86
|
-
EditPageThumbnail,
|
|
87
|
-
draggable,
|
|
88
|
-
},
|
|
89
|
-
props: {
|
|
90
|
-
splittingLines: {
|
|
91
|
-
type: Array,
|
|
92
|
-
default: null,
|
|
93
|
-
},
|
|
94
|
-
splitSuggestionsEnabled: {
|
|
95
|
-
type: Boolean,
|
|
96
|
-
default: false,
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
data() {
|
|
100
|
-
return {
|
|
101
|
-
editPages: null,
|
|
102
|
-
};
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
computed: {
|
|
106
|
-
...mapState("document", [
|
|
107
|
-
"pages",
|
|
108
|
-
"recalculatingAnnotations",
|
|
109
|
-
"selectedDocument",
|
|
110
|
-
"splittingSuggestions",
|
|
111
|
-
]),
|
|
112
|
-
...mapState("edit", [
|
|
113
|
-
"editMode",
|
|
114
|
-
"pagesForPostprocess",
|
|
115
|
-
"renameAndCategorize",
|
|
116
|
-
]),
|
|
117
|
-
},
|
|
118
|
-
watch: {
|
|
119
|
-
pagesForPostprocess(newValue, oldValue) {
|
|
120
|
-
if (newValue !== oldValue) {
|
|
121
|
-
this.editPages = newValue;
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
editPages(newValue, oldValue) {
|
|
125
|
-
if (newValue !== oldValue) {
|
|
126
|
-
this.$store.dispatch("edit/setPagesForPostprocess", newValue);
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
renameAndCategorize(newValue) {
|
|
130
|
-
if (newValue) {
|
|
131
|
-
this.editPages = this.pagesForPostprocess;
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
mounted() {
|
|
136
|
-
this.editPages = this.pagesForPostprocess;
|
|
137
|
-
},
|
|
138
|
-
methods: {
|
|
139
|
-
deselect() {
|
|
140
|
-
this.$store.dispatch("edit/setSelectedPages");
|
|
141
|
-
},
|
|
142
|
-
getRotation(pageId) {
|
|
143
|
-
// rotate page
|
|
144
|
-
return this.pagesForPostprocess?.find((p) => p.id === pageId)?.angle;
|
|
145
|
-
},
|
|
146
|
-
handleSplittingLines(page, origin) {
|
|
147
|
-
this.$emit("handle-splitting-lines", page, origin);
|
|
148
|
-
},
|
|
149
|
-
checkMove(event) {
|
|
150
|
-
this.$emit("check-move", event);
|
|
151
|
-
},
|
|
152
|
-
handleDragEnd() {
|
|
153
|
-
this.draggable = false;
|
|
154
|
-
|
|
155
|
-
this.$emit("handle-drag-end");
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
</script>
|
|
160
|
-
|
|
161
|
-
<style scoped lang="scss" src="../../assets/scss/document_edit.scss"></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="edit-pages">
|
|
3
|
+
<div class="grid-header">
|
|
4
|
+
<span class="header-title">{{ $t("rotate_split_reorder") }}</span>
|
|
5
|
+
</div>
|
|
6
|
+
<draggable
|
|
7
|
+
v-model="editPages"
|
|
8
|
+
class="document-grid"
|
|
9
|
+
easing="cubic-bezier(0.37, 0, 0.63, 1)"
|
|
10
|
+
@start="dragging = true"
|
|
11
|
+
@end="handleDragEnd"
|
|
12
|
+
@move="checkMove"
|
|
13
|
+
>
|
|
14
|
+
<div
|
|
15
|
+
v-for="(page, index) in editPages"
|
|
16
|
+
:key="page.id"
|
|
17
|
+
class="image-section"
|
|
18
|
+
tabindex="0"
|
|
19
|
+
>
|
|
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>
|
|
38
|
+
<div
|
|
39
|
+
v-if="
|
|
40
|
+
splittingLines && splittingLines[index].page === page.number
|
|
41
|
+
"
|
|
42
|
+
class="lines active-split"
|
|
43
|
+
>
|
|
44
|
+
<SplitZigZag
|
|
45
|
+
:color="
|
|
46
|
+
splittingLines &&
|
|
47
|
+
splittingLines[index].origin &&
|
|
48
|
+
splittingLines[index].origin === 'AI' &&
|
|
49
|
+
splitSuggestionsEnabled
|
|
50
|
+
? 'green'
|
|
51
|
+
: 'dark'
|
|
52
|
+
"
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
<div v-else class="lines not-active-split">
|
|
56
|
+
<SplitLines />
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="bottom-section">
|
|
61
|
+
<span class="page-number">{{ page.number }}</span>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</draggable>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script>
|
|
69
|
+
/**
|
|
70
|
+
* This component renders a grid of the document pages
|
|
71
|
+
* that will be possible to resort, split and/or rotate
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
import { mapState } from "vuex";
|
|
75
|
+
import SplitLines from "../../assets/images/SplitLines";
|
|
76
|
+
import SplitZigZag from "../../assets/images/SplitZigZag";
|
|
77
|
+
import EditPageThumbnail from "./EditPageThumbnail";
|
|
78
|
+
|
|
79
|
+
import draggable from "vuedraggable";
|
|
80
|
+
|
|
81
|
+
export default {
|
|
82
|
+
name: "EditPages",
|
|
83
|
+
components: {
|
|
84
|
+
SplitLines,
|
|
85
|
+
SplitZigZag,
|
|
86
|
+
EditPageThumbnail,
|
|
87
|
+
draggable,
|
|
88
|
+
},
|
|
89
|
+
props: {
|
|
90
|
+
splittingLines: {
|
|
91
|
+
type: Array,
|
|
92
|
+
default: null,
|
|
93
|
+
},
|
|
94
|
+
splitSuggestionsEnabled: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
data() {
|
|
100
|
+
return {
|
|
101
|
+
editPages: null,
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
computed: {
|
|
106
|
+
...mapState("document", [
|
|
107
|
+
"pages",
|
|
108
|
+
"recalculatingAnnotations",
|
|
109
|
+
"selectedDocument",
|
|
110
|
+
"splittingSuggestions",
|
|
111
|
+
]),
|
|
112
|
+
...mapState("edit", [
|
|
113
|
+
"editMode",
|
|
114
|
+
"pagesForPostprocess",
|
|
115
|
+
"renameAndCategorize",
|
|
116
|
+
]),
|
|
117
|
+
},
|
|
118
|
+
watch: {
|
|
119
|
+
pagesForPostprocess(newValue, oldValue) {
|
|
120
|
+
if (newValue !== oldValue) {
|
|
121
|
+
this.editPages = newValue;
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
editPages(newValue, oldValue) {
|
|
125
|
+
if (newValue !== oldValue) {
|
|
126
|
+
this.$store.dispatch("edit/setPagesForPostprocess", newValue);
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
renameAndCategorize(newValue) {
|
|
130
|
+
if (newValue) {
|
|
131
|
+
this.editPages = this.pagesForPostprocess;
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
mounted() {
|
|
136
|
+
this.editPages = this.pagesForPostprocess;
|
|
137
|
+
},
|
|
138
|
+
methods: {
|
|
139
|
+
deselect() {
|
|
140
|
+
this.$store.dispatch("edit/setSelectedPages");
|
|
141
|
+
},
|
|
142
|
+
getRotation(pageId) {
|
|
143
|
+
// rotate page
|
|
144
|
+
return this.pagesForPostprocess?.find((p) => p.id === pageId)?.angle;
|
|
145
|
+
},
|
|
146
|
+
handleSplittingLines(page, origin) {
|
|
147
|
+
this.$emit("handle-splitting-lines", page, origin);
|
|
148
|
+
},
|
|
149
|
+
checkMove(event) {
|
|
150
|
+
this.$emit("check-move", event);
|
|
151
|
+
},
|
|
152
|
+
handleDragEnd() {
|
|
153
|
+
this.draggable = false;
|
|
154
|
+
|
|
155
|
+
this.$emit("handle-drag-end");
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
</script>
|
|
160
|
+
|
|
161
|
+
<style scoped lang="scss" src="../../assets/scss/document_edit.scss"></style>
|