@konfuzio/document-validation-ui 0.1.55-dev.1 → 0.1.55

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 (60) 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/dist/js/chunk-vendors.js +23 -66
  6. package/dist/js/chunk-vendors.js.map +1 -1
  7. package/jest.config.js +2 -22
  8. package/package.json +37 -31
  9. package/src/assets/scss/ann_set_table_options.scss +4 -4
  10. package/src/assets/scss/annotation_action_buttons.scss +7 -7
  11. package/src/assets/scss/annotation_details.scss +9 -9
  12. package/src/assets/scss/choose_label_set_modal.scss +5 -5
  13. package/src/assets/scss/document_action_bar.scss +3 -3
  14. package/src/assets/scss/document_annotations.scss +38 -40
  15. package/src/assets/scss/document_category.scss +8 -8
  16. package/src/assets/scss/document_dashboard.scss +1 -1
  17. package/src/assets/scss/document_edit.scss +28 -29
  18. package/src/assets/scss/document_error.scss +6 -6
  19. package/src/assets/scss/document_name.scss +6 -6
  20. package/src/assets/scss/document_page.scss +3 -3
  21. package/src/assets/scss/document_search_bar.scss +7 -7
  22. package/src/assets/scss/document_set_chooser.scss +3 -2
  23. package/src/assets/scss/document_thumbnails.scss +7 -7
  24. package/src/assets/scss/document_toolbar.scss +10 -10
  25. package/src/assets/scss/document_top_bar.scss +21 -10
  26. package/src/assets/scss/document_viewport_modal.scss +3 -3
  27. package/src/assets/scss/documents_list.scss +12 -11
  28. package/src/assets/scss/edit_page_thumbnail.scss +6 -6
  29. package/src/assets/scss/empty_state.scss +4 -4
  30. package/src/assets/scss/error_page.scss +2 -2
  31. package/src/assets/scss/extracting_data.scss +3 -3
  32. package/src/assets/scss/imports.scss +1 -0
  33. package/src/assets/scss/multi_ann_table_overlay.scss +3 -3
  34. package/src/assets/scss/multi_ann_table_popup.scss +1 -1
  35. package/src/assets/scss/new_annotation.scss +14 -21
  36. package/src/assets/scss/scrolling_document.scss +1 -1
  37. package/src/assets/scss/theme.scss +52 -63
  38. package/src/assets/scss/variables.scss +0 -2
  39. package/src/components/App.vue +28 -9
  40. package/src/components/DocumentAnnotations/AnnotationActionButtons.vue +5 -2
  41. package/src/components/DocumentAnnotations/AnnotationRow.vue +2 -9
  42. package/src/components/DocumentAnnotations/ChooseLabelSetModal.vue +8 -2
  43. package/src/components/DocumentAnnotations/DocumentAnnotations.vue +10 -11
  44. package/src/components/DocumentDashboard.vue +16 -11
  45. package/src/components/DocumentEdit/EditPages.vue +48 -48
  46. package/src/components/DocumentModals/DocumentErrorModal.vue +5 -0
  47. package/src/components/DocumentPage/DocumentPage.vue +15 -5
  48. package/src/components/DocumentPage/EditAnnotation.vue +23 -14
  49. package/src/components/DocumentPage/NewAnnotation.vue +27 -27
  50. package/src/components/DocumentTopBar/DocumentTopBar.vue +13 -1
  51. package/src/components/DocumentsList/DocumentsList.vue +2 -1
  52. package/src/components/ErrorMessage.vue +6 -1
  53. package/src/constants.js +7 -1
  54. package/src/i18n.js +5 -2
  55. package/src/locales/de.json +5 -2
  56. package/src/locales/en.json +5 -2
  57. package/src/locales/es.json +5 -2
  58. package/src/main.js +16 -13
  59. package/src/store/display.js +30 -33
  60. package/src/store/index.js +8 -5
@@ -3,7 +3,11 @@
3
3
  <div v-if="serverError" class="message-container">
4
4
  <span class="server-error">
5
5
  {{ errorMessage }}
6
- <span class="contact-support" @click="handleGetSupport">
6
+ <span
7
+ v-if="showBranding"
8
+ class="contact-support"
9
+ @click="handleGetSupport"
10
+ >
7
11
  {{ $t("get_support") }} <b-icon icon="arrow-right" size="is-small"
8
12
  /></span>
9
13
  </span>
@@ -24,6 +28,7 @@ export default {
24
28
  name: "ErrorMessage",
25
29
  computed: {
26
30
  ...mapState("document", ["errorMessage", "serverError"]),
31
+ ...mapState("display", ["showBranding"]),
27
32
  },
28
33
  methods: {
29
34
  handleGetSupport() {
package/src/constants.js CHANGED
@@ -2,4 +2,10 @@ export const PIXEL_RATIO = window.devicePixelRatio || 1;
2
2
  export const VIEWPORT_RATIO = 0.98;
3
3
  export const MINIMUM_APP_WIDTH = 600;
4
4
  export const MINIMUM_OPTIMIZED_APP_WIDTH = 950;
5
- export const TEXT_BREAKPOINT_WIDTH = 1800;
5
+ export const TEXT_BREAKPOINT_WIDTH = (locale) => {
6
+ if (locale === "en") {
7
+ return 1350;
8
+ } else {
9
+ return 1800;
10
+ }
11
+ };
package/src/i18n.js CHANGED
@@ -1,4 +1,7 @@
1
- import { createI18n } from "vue-i18n";
1
+ import Vue from "vue";
2
+ import VueI18n from "vue-i18n";
3
+
4
+ Vue.use(VueI18n);
2
5
 
3
6
  function loadLocaleMessages() {
4
7
  const locales = require.context(
@@ -17,7 +20,7 @@ function loadLocaleMessages() {
17
20
  return messages;
18
21
  }
19
22
 
20
- export const i18n = createI18n({
23
+ export default new VueI18n({
21
24
  locale: process.env.VUE_APP_LOCALE || "en",
22
25
  fallbackLocale: "en",
23
26
  messages: loadLocaleMessages(),
@@ -103,6 +103,7 @@
103
103
  "server_error": "Wir haben derzeit ein Serverproblem. Bitte versuchen Sie es später noch einmal oder",
104
104
  "get_support": "Hole dir Unterstützung",
105
105
  "no_labels_available": "Das ausgewählte Annotations-Set enthält keine nicht ausgefüllten oder multiplen Labels.",
106
+ "no_labels_available_link": "Weitere Informationen finden Sie unter <a href='https://help.konfuzio.com/modules/labels/index.html#multiple' target='_blank'>diesem Link</a>.",
106
107
  "new_ann_set_title": "Neues Annotations-Set",
107
108
  "new_ann_set_description": "Wählen Sie ein Datenmodell aus den vorhandenen aus. Das neue Annotations-Set enthält dieselben Beschriftungen.",
108
109
  "select_label_set": "Wählen Sie das Label-Set-Modell aus",
@@ -113,7 +114,8 @@
113
114
  "new_multi_ann_description": "Wählen Sie ein Datenmodell aus den vorhandenen aus und deaktivieren Sie dann die Labels, die in diesem Dokument nicht vorhanden sind.",
114
115
  "drag_drop_columns_multi_ann": "Drag and Drop, um die Reihenfolge der Labels zu ändern",
115
116
  "error_creating_multi_ann": "Nicht alle Annotationen wurden erfolgreich erstellt.",
116
- "no_multi_ann_labelset_model": "Es gibt keine verfügbaren Label Sets, die mehrfach in diesem Dokument zu finden sind. Weitere Informationen finden Sie unter <a href='https://help.konfuzio.com/tutorials/advanced-document-extraction/index.html#multiple-annotation-sets' target='_blank'>diesem Link</a>.",
117
+ "no_multi_ann_labelset_model": "Es gibt keine verfügbaren Label Sets, die mehrfach in diesem Dokument zu finden sind.",
118
+ "no_multi_ann_labelset_model_link": "Weitere Informationen finden Sie unter <a href='https://help.konfuzio.com/tutorials/advanced-document-extraction/index.html#multiple-annotation-sets' target='_blank'>diesem Link</a>.",
117
119
  "single_category_in_project": "Das aktuelle Projekt hat nur eine Kategorie. Um sie ändern zu können, sollte die neue zuerst dem Projekt hinzugefügt werden.",
118
120
  "approved_annotations": "Die Kategorie kann nicht geändert werden, da bereits akzeptierte Annotationen oder manuell erstellte Annotationen zu diesem Dokument vorhanden sind.",
119
121
  "restore": "Wiederherstellen",
@@ -163,5 +165,6 @@
163
165
  "copied": "Kopiert",
164
166
  "checkbox_ann_details": "Für dieses Label wird ein Kästchen extrahiert.",
165
167
  "document_section": "Dokumentabschnitt",
166
- "label_size": "Spaltengröße:"
168
+ "label_size": "Spaltengröße:",
169
+ "powered_by": "betrieben von Konfuzio"
167
170
  }
@@ -110,12 +110,14 @@
110
110
  "server_error": "We are currently experiencing a server issue. Please try again later or",
111
111
  "get_support": "Get Support",
112
112
  "no_labels_available": "There are no unfilled or multiple labels in the selected annotation set.",
113
+ "no_labels_available_link": "For more details, you can visit <a href='https://help.konfuzio.com/modules/labels/index.html#multiple' target='_blank'>this link</a>.",
113
114
  "new_multi_ann_title": "Create multiple annotations",
114
115
  "new_multi_ann_description": "Select a data model from the existing ones, then deselect the labels that don't exist in this document.",
115
116
  "drag_drop_columns_multi_ann": "Drag and drop to change the order of the labels",
116
117
  "error_creating_multi_ann": "Not all annotation sets were created successfully.",
117
118
  "disabled_finish_review": "Finishing the document review is only possible after all annotations have been revised, whether they are accepted or marked as missing.",
118
- "no_multi_ann_labelset_model": "There are no available label sets that can be found multiple times in this document. For more details, you can visit <a href='https://help.konfuzio.com/tutorials/advanced-document-extraction/index.html#multiple-annotation-sets' target='_blank'>this link</a>.",
119
+ "no_multi_ann_labelset_model": "There are no available label sets that can be found multiple times in this document.",
120
+ "no_multi_ann_labelset_model_link": "For more details, you can visit <a href='https://help.konfuzio.com/tutorials/advanced-document-extraction/index.html#multiple-annotation-sets' target='_blank'>this link</a>.",
119
121
  "single_category_in_project": "The current project has only one category. To be able to change it, the new one should be first added to the project.",
120
122
  "approved_annotations": "It is not possible to change the current category since the document has approved or manually created annotations.",
121
123
  "restore": "Restore",
@@ -164,5 +166,6 @@
164
166
  "copied": "Copied",
165
167
  "checkbox_ann_details": "A checkbox will be extracted for this label.",
166
168
  "document_section": "Document Section",
167
- "label_size": "Column size:"
169
+ "label_size": "Column size:",
170
+ "powered_by": "powered by Konfuzio"
168
171
  }
@@ -103,6 +103,7 @@
103
103
  "server_error": "Estamos experimentando problemas con el servidor. Por favor, repita la operación o ",
104
104
  "get_support": "Contacte al Soporte",
105
105
  "no_labels_available": "No hay etiquetas vacías o múltiples en el grupo de anotaciones seleccionado.",
106
+ "no_labels_available_link": "Para más información, haz clic en <a href='https://help.konfuzio.com/modules/labels/index.html#multiple' target='_blank'>este enlace</a>.",
106
107
  "new_ann_set_title": "Crear anotaciones múltiples",
107
108
  "new_ann_set_description": "Seleccione un modelo de datos de las opciones disponibles, y luego deseleccione las etiquetas que no existen en este documento.",
108
109
  "select_label_set": "Seleccione un modelo de grupo de etiquetas",
@@ -112,7 +113,8 @@
112
113
  "drag_drop_columns_multi_ann": "Arrastre y suelte las columnas para ordenar las etiquetas",
113
114
  "error_creating_multi_ann": "No todos los grupos de anotaciones fueron creados de manera exitosa.",
114
115
  "disabled_finish_review": "Solo es posible finalizar la revisión del documento si todas las anotaciones han sido revisadas, ya sea aceptadas o marcadas como faltantes.",
115
- "no_multi_ann_labelset_model": "En este documento no hay grupos de etiquetas múltiples disponibles. Para más información, haga clic en <a href='https://help.konfuzio.com/tutorials/advanced-document-extraction/index.html#multiple-annotation-sets' target='_blank'>este enlace</a>.",
116
+ "no_multi_ann_labelset_model": "En este documento no hay grupos de etiquetas múltiples disponibles.",
117
+ "no_multi_ann_labelset_model_link": "Para más información, haga clic en <a href='https://help.konfuzio.com/tutorials/advanced-document-extraction/index.html#multiple-annotation-sets' target='_blank'>este enlace</a>.",
116
118
  "single_category_in_project": "Este proyecto solo tiene una categoría. Para poder modificarla, es necesario agregar esta nueva categoría al proyecto.",
117
119
  "approved_annotations": "No es posible cambiar la categoría ya que existen anotaciones aceptadas o creadas manualmente en este documento.",
118
120
  "restore": "Restaurar",
@@ -163,5 +165,6 @@
163
165
  "copied": "Copiada",
164
166
  "checkbox_ann_details": "Se extraerá una casilla de verificación para esta etiqueta.",
165
167
  "document_section": "Sección del documento",
166
- "label_size": "Tamaño de columna:"
168
+ "label_size": "Tamaño de columna:",
169
+ "powered_by": "impulsado por Konfuzio"
167
170
  }
package/src/main.js CHANGED
@@ -1,30 +1,33 @@
1
1
  import App from "./components/App";
2
- import { createApp } from "vue";
2
+ import Vue from "vue";
3
3
  import Buefy from "buefy";
4
4
  import VueKonva from "vue-konva";
5
- import { i18n } from "./i18n";
6
- import { store } from "./store";
7
- import VueObserveVisibility from "vue3-observe-visibility";
5
+ import i18n from "./i18n";
6
+ import store from "./store";
7
+ import VueObserveVisibility from "vue-observe-visibility";
8
8
  import Icons from "./icons";
9
+ import VueSplit from "vue-split-panel";
9
10
 
10
11
  // Log app version
11
12
  console.log(
12
13
  `${require("../package.json").name} ${require("../package.json").version}`
13
14
  );
14
15
 
15
- const app = createApp(App);
16
-
17
- app.component("VueFontawesome", Icons);
18
- app.use(VueKonva);
19
- app.use(Buefy, {
16
+ Vue.component("VueFontawesome", Icons);
17
+ Vue.component("App", App);
18
+ Vue.use(VueKonva);
19
+ Vue.use(Buefy, {
20
20
  defaultIconPack: "fas",
21
21
  defaultIconComponent: "vue-fontawesome",
22
22
  });
23
- app.use(VueObserveVisibility);
24
- app.use(store);
25
- app.use(i18n);
23
+ Vue.use(VueObserveVisibility);
24
+ Vue.use(VueSplit);
26
25
 
27
26
  /**
28
27
  * Main entrypoint for the App
29
28
  */
30
- app.mount("#app");
29
+ new Vue({
30
+ i18n,
31
+ store,
32
+ el: "#app",
33
+ });
@@ -37,6 +37,7 @@ const state = {
37
37
  pageError: null,
38
38
  labelWidth: 40,
39
39
  annotationWidth: 60,
40
+ showBranding: true,
40
41
  };
41
42
 
42
43
  const getters = {
@@ -112,43 +113,32 @@ const getters = {
112
113
  * image rendering.
113
114
  */
114
115
  imageScale: (state) => (page) => {
115
- if (
116
- page.size &&
117
- page.size.length > 0 &&
118
- page.original_size &&
119
- page.original_size.length > 0
120
- ) {
121
- return new BigNumber(page.size[0]).div(page.original_size[0]).toNumber();
122
- }
123
- return 0;
116
+ return new BigNumber(page.size[0]).div(page.original_size[0]).toNumber();
124
117
  },
125
118
  bboxToPoint:
126
119
  (state, getters) =>
127
120
  (page, point, hasOffset = false) => {
128
- if (page && page.original_size && page.original_size.length > 1) {
129
- const imageScale = getters.imageScale(page);
130
- const { x, y } = point;
131
- const pageHeight = new BigNumber(page.original_size[1]);
132
- const newPoint = {
133
- // left
134
- x: new BigNumber(x)
135
- .minus(hasOffset ? 1 : 0)
136
- .times(state.scale)
137
- .times(imageScale)
138
- .div(PIXEL_RATIO)
139
- .toNumber(),
140
- // top
141
- y: pageHeight
142
- .minus(new BigNumber(y))
143
- .minus(hasOffset ? 17.1 : 0)
144
- .times(state.scale)
145
- .times(imageScale)
146
- .div(PIXEL_RATIO)
147
- .toNumber(),
148
- };
149
- return newPoint;
150
- }
151
- return { x: 0, y: 0 };
121
+ const imageScale = getters.imageScale(page);
122
+ const { x, y } = point;
123
+ const pageHeight = new BigNumber(page.original_size[1]);
124
+ const newPoint = {
125
+ // left
126
+ x: new BigNumber(x)
127
+ .minus(hasOffset ? 1 : 0)
128
+ .times(state.scale)
129
+ .times(imageScale)
130
+ .div(PIXEL_RATIO)
131
+ .toNumber(),
132
+ // top
133
+ y: pageHeight
134
+ .minus(new BigNumber(y))
135
+ .minus(hasOffset ? 17.1 : 0)
136
+ .times(state.scale)
137
+ .times(imageScale)
138
+ .div(PIXEL_RATIO)
139
+ .toNumber(),
140
+ };
141
+ return newPoint;
152
142
  },
153
143
  bboxToRect:
154
144
  (state, getters) =>
@@ -308,6 +298,9 @@ const actions = {
308
298
  showDocumentsNavigation({ commit }, show) {
309
299
  commit("SET_SHOW_DOCUMENTS_NAVIGATION", show);
310
300
  },
301
+ showBranding({ commit }, show) {
302
+ commit("SET_SHOW_BRANDING", show);
303
+ },
311
304
  showChooseLabelSetModal({ commit }, options) {
312
305
  commit("SET_SHOW_CHOOSE_LABEL_SET_MODAL", options);
313
306
  },
@@ -432,6 +425,10 @@ const mutations = {
432
425
  state.showDocumentsNavigation = show;
433
426
  },
434
427
 
428
+ SET_SHOW_BRANDING: (state, show) => {
429
+ state.showBranding = show;
430
+ },
431
+
435
432
  SET_ANN_SET_TABLE: (state, tableSet) => {
436
433
  state.showAnnSetTable = tableSet;
437
434
  },
@@ -1,4 +1,5 @@
1
- import { createStore } from "vuex";
1
+ import Vue from "vue";
2
+ import Vuex from "vuex";
2
3
 
3
4
  import display from "./display";
4
5
  import document from "./document";
@@ -7,13 +8,15 @@ import project from "./project";
7
8
  import selection from "./selection";
8
9
  import edit from "./edit";
9
10
 
10
- export const store = createStore({
11
+ Vue.use(Vuex);
12
+
13
+ export default new Vuex.Store({
11
14
  modules: {
12
15
  display,
13
16
  document,
14
17
  category,
15
18
  project,
16
19
  selection,
17
- edit,
18
- },
19
- });
20
+ edit
21
+ }
22
+ });