@konfuzio/document-validation-ui 0.1.5-automatic-document-splitting-3 → 0.1.5-styles-refactor

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 (44) 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/package.json +1 -1
  6. package/src/.DS_Store +0 -0
  7. package/src/api.js +31 -21
  8. package/src/assets/images/ServerImage.vue +5 -4
  9. package/src/assets/images/SplitZigZag.vue +14 -47
  10. package/src/assets/scss/document_category.scss +1 -0
  11. package/src/assets/scss/document_dashboard.scss +0 -6
  12. package/src/assets/scss/document_edit.scss +46 -131
  13. package/src/assets/scss/main.scss +666 -7
  14. package/src/assets/scss/variables.scss +0 -719
  15. package/src/components/App.vue +3 -2
  16. package/src/components/DocumentAnnotations/CategorizeModal.vue +2 -22
  17. package/src/components/DocumentAnnotations/DocumentAnnotations.vue +3 -11
  18. package/src/components/DocumentCategory.vue +5 -13
  19. package/src/components/DocumentDashboard.vue +6 -17
  20. package/src/components/DocumentEdit/DocumentEdit.vue +78 -220
  21. package/src/components/DocumentEdit/EditPages.vue +18 -29
  22. package/src/components/DocumentEdit/EditSidebar.vue +45 -95
  23. package/src/components/DocumentEdit/SplitOverview.vue +5 -4
  24. package/src/components/{DocumentModals/DocumentErrorModal.vue → DocumentError.vue} +4 -3
  25. package/src/components/DocumentPage/DocumentPage.vue +9 -7
  26. package/src/components/DocumentPage/ScrollingDocument.vue +34 -4
  27. package/src/components/DocumentPage/ScrollingPage.vue +4 -5
  28. package/src/components/DocumentThumbnails/DocumentThumbnails.vue +14 -11
  29. package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +20 -6
  30. package/src/components/{DocumentModals/NotOptimizedViewportModal.vue → NotOptimizedViewportModal.vue} +2 -2
  31. package/src/locales/de.json +2 -15
  32. package/src/locales/en.json +1 -15
  33. package/src/locales/es.json +1 -14
  34. package/src/store/display.js +7 -0
  35. package/src/store/document.js +16 -41
  36. package/src/store/edit.js +50 -68
  37. package/src/store/project.js +14 -14
  38. package/src/assets/images/MagicWandIcon.vue +0 -16
  39. package/src/assets/images/StarIcon.vue +0 -16
  40. package/src/assets/scss/splitting_confirmation_modal.scss +0 -41
  41. package/src/components/DocumentEdit/EditConfirmationModal.vue +0 -54
  42. package/src/components/DocumentEdit/SidebarButtons.vue +0 -53
  43. package/src/components/DocumentEdit/SplitInfoBar.vue +0 -19
  44. package/src/components/DocumentModals/SplittingSuggestionsModal.vue +0 -121
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.1.5-automatic-document-splitting-3",
3
+ "version": "0.1.5-styles-refactor",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
package/src/.DS_Store CHANGED
Binary file
package/src/api.js CHANGED
@@ -1,7 +1,5 @@
1
1
  import axios from "axios";
2
- import {
3
- cacheAdapterEnhancer
4
- } from 'axios-extensions';
2
+ import { cacheAdapterEnhancer } from "axios-extensions";
5
3
 
6
4
  let HTTP, IMG_REQUEST, authToken;
7
5
  const DEFAULT_URL = "https://app.konfuzio.com";
@@ -10,40 +8,52 @@ axios.defaults.xsrfCookieName = "csrftoken";
10
8
  axios.defaults.xsrfHeaderName = "X-CSRFToken";
11
9
 
12
10
  HTTP = axios.create({
13
- baseURL: process.env.VUE_APP_API_URL || `${DEFAULT_URL}/api/v3/`
11
+ baseURL: process.env.VUE_APP_API_URL || `${DEFAULT_URL}/api/v3/`,
14
12
  });
15
13
 
16
14
  IMG_REQUEST = axios.create({
17
15
  baseURL: process.env.VUE_APP_DOCUMENT_IMAGES_URL || `${DEFAULT_URL}`,
18
16
  responseType: "blob",
19
- adapter: cacheAdapterEnhancer(axios.defaults.adapter)
17
+ adapter: cacheAdapterEnhancer(axios.defaults.adapter),
20
18
  });
21
19
 
22
20
  const setAuthToken = (token) => {
23
21
  authToken = token;
24
- }
22
+ };
25
23
 
26
24
  const getInterceptorConfig = (config) => {
27
25
  if (authToken) {
28
- config.headers['Authorization'] = `Token ${authToken}`;
26
+ config.headers["Authorization"] = `Token ${authToken}`;
29
27
  }
30
28
  return config;
31
- }
29
+ };
32
30
 
33
- HTTP.interceptors.request.use(getInterceptorConfig,
34
- error => {
35
- return Promise.reject(error);
36
- }
37
- );
31
+ HTTP.interceptors.request.use(getInterceptorConfig, (error) => {
32
+ return Promise.reject(error);
33
+ });
38
34
 
39
- IMG_REQUEST.interceptors.request.use(getInterceptorConfig,
40
- error => {
41
- return Promise.reject(error);
42
- }
43
- );
35
+ IMG_REQUEST.interceptors.request.use(getInterceptorConfig, (error) => {
36
+ return Promise.reject(error);
37
+ });
38
+
39
+ const makeImageRequest = (imageURL) => {
40
+ return new Promise((resolve, reject) => {
41
+ if (process.env.NODE_ENV === "test") {
42
+ reject("Running unit tests!");
43
+ return;
44
+ }
45
+ IMG_REQUEST.get(imageURL)
46
+ .then((response) => {
47
+ return response.data;
48
+ })
49
+ .then((myBlob) => {
50
+ resolve(myBlob);
51
+ });
52
+ });
53
+ };
44
54
 
45
55
  export default {
46
56
  HTTP,
47
- IMG_REQUEST,
48
- setAuthToken
49
- };
57
+ makeImageRequest,
58
+ setAuthToken,
59
+ };
@@ -40,10 +40,8 @@ export default {
40
40
  methods: {
41
41
  loadImage() {
42
42
  if (!this.imageUrl) return;
43
- return api.IMG_REQUEST.get(this.imageUrl)
44
- .then((response) => {
45
- return response.data;
46
- })
43
+ return api
44
+ .makeImageRequest(this.imageUrl)
47
45
  .then((myBlob) => {
48
46
  this.$refs.imgTag.src = URL.createObjectURL(myBlob);
49
47
  if (this.height) {
@@ -53,6 +51,9 @@ export default {
53
51
  this.$refs.imgTag.style.width = this.width;
54
52
  }
55
53
  this.loaded = true;
54
+ })
55
+ .catch((error) => {
56
+ this.loaded = false;
56
57
  });
57
58
  },
58
59
  },
@@ -1,49 +1,16 @@
1
1
  <template>
2
- <div>
3
- <svg
4
- v-if="color === 'dark'"
5
- width="6"
6
- height="57"
7
- viewBox="0 0 6 57"
8
- fill="none"
9
- xmlns="http://www.w3.org/2000/svg"
10
- >
11
- <path
12
- d="M1 1L5 7.875L1 14.75L5 21.625L1 28.5L5 35.375L1 42.25L5 49.125L1 56"
13
- stroke="#1A1A1A"
14
- stroke-linecap="round"
15
- stroke-linejoin="round"
16
- />
17
- </svg>
18
-
19
- <svg
20
- v-if="color === 'green'"
21
- width="6"
22
- height="52"
23
- viewBox="0 0 6 52"
24
- fill="none"
25
- xmlns="http://www.w3.org/2000/svg"
26
- >
27
- <path
28
- d="M1 1.67383L5 7.81966L1 13.9655L5 20.1113L1 26.2572L5 32.403L1 38.5488L5 44.6947L1 50.8405"
29
- stroke="#44B78B"
30
- stroke-width="1.5"
31
- stroke-linecap="round"
32
- stroke-linejoin="round"
33
- />
34
- </svg>
35
- </div>
2
+ <svg
3
+ width="6"
4
+ height="57"
5
+ viewBox="0 0 6 57"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ >
9
+ <path
10
+ d="M1 1L5 7.875L1 14.75L5 21.625L1 28.5L5 35.375L1 42.25L5 49.125L1 56"
11
+ stroke="#1A1A1A"
12
+ stroke-linecap="round"
13
+ stroke-linejoin="round"
14
+ />
15
+ </svg>
36
16
  </template>
37
-
38
- <script>
39
- export default {
40
- name: "SplitZigZag",
41
- props: {
42
- color: {
43
- type: String,
44
- default: null,
45
- required: false,
46
- },
47
- },
48
- };
49
- </script>
@@ -42,6 +42,7 @@
42
42
 
43
43
  .category-info {
44
44
  min-width: 100px;
45
+ width: 100px;
45
46
  margin-left: 5px;
46
47
  margin-right: 5px;
47
48
 
@@ -25,12 +25,6 @@
25
25
  background-size: 9px 9px;
26
26
  }
27
27
 
28
- &.edit-mode {
29
- .dashboard-document {
30
- flex: 1.5;
31
- }
32
- }
33
-
34
28
  @media print {
35
29
  .dashboard-document {
36
30
  position: static;
@@ -7,6 +7,7 @@
7
7
 
8
8
  &.split-overview-component {
9
9
  min-width: 600px;
10
+ flex: 0;
10
11
  }
11
12
 
12
13
  .pages-section {
@@ -14,9 +15,6 @@
14
15
  overflow-y: scroll;
15
16
  border-right: $component-border;
16
17
  border-left: $component-border;
17
- display: flex;
18
- flex-direction: column;
19
- justify-content: space-between;
20
18
 
21
19
  .document-grid {
22
20
  padding: 42px;
@@ -167,128 +165,86 @@
167
165
  }
168
166
  }
169
167
  }
170
-
171
- .info-bar {
172
- position: sticky;
173
- width: -moz-fit-content;
174
- width: fit-content;
175
- bottom: 20px;
176
- left: 0;
177
- right: 0;
178
- margin: 0 auto;
179
- padding: 10px;
180
-
181
- .split-info-bar {
182
- padding: 5px 13px;
183
- min-height: 32px;
184
- height: auto;
185
- display: flex;
186
- align-items: center;
187
- justify-content: center;
188
- gap: 3px;
189
- background-color: $text-color;
190
- color: $white;
191
- font-weight: 400;
192
- font-size: 14px;
193
- border-radius: 52px;
194
- text-align: center;
195
- }
196
- }
197
168
  }
198
169
 
199
170
  .sidebar {
200
171
  width: 45%;
201
- max-width: 300px;
202
- min-width: 270px;
203
172
  background-color: $background;
204
173
 
205
174
  .edit-sidebar {
206
175
  display: flex;
207
176
  flex-direction: column;
208
177
  align-items: center;
209
- justify-content: flex-start;
178
+ justify-content: center;
210
179
  text-align: center;
211
- height: 100%;
180
+ height: calc(100% - 60px);
181
+ gap: 50px;
182
+
183
+ .sidebar-header {
184
+ width: 85%;
185
+ height: 50%;
186
+
187
+ h3 {
188
+ color: $text-color;
189
+ font-weight: 600;
190
+ font-size: 16px;
191
+ line-height: 24px;
192
+ padding-bottom: 15px;
193
+ }
194
+
195
+ .description {
196
+ color: $grey;
197
+ font-size: 14px;
198
+ font-weight: 400;
199
+ line-height: 20px;
200
+
201
+ &:last-child {
202
+ padding-top: 12px;
203
+ }
204
+ }
205
+ }
212
206
 
213
207
  .buttons-container {
214
208
  width: 85%;
215
209
  display: flex;
216
210
  flex-direction: column;
211
+ gap: 24px;
217
212
  color: $grey-dark;
218
213
 
219
214
  .pages-selected {
220
215
  font-weight: 400;
221
216
  font-size: 14px;
222
- margin-bottom: 15px;
223
217
 
224
218
  &.disabled {
225
219
  color: $grey;
226
220
  }
227
221
  }
228
222
 
229
- .edit-buttons {
223
+ .rotate {
230
224
  display: flex;
231
225
  flex-direction: column;
232
226
  gap: 8px;
233
- border-bottom: 1px solid $grey-detail;
234
-
235
- .sidebar-buttons {
236
- .edit-mode-btn {
237
- display: flex;
238
- width: 100%;
239
-
240
- .button-content {
241
- display: flex;
242
- align-items: center;
243
- justify-content: center;
244
- gap: 9px;
245
-
246
- .button-text {
247
- font-size: 14px;
248
- font-weight: 500;
249
- max-width: 70%;
250
- }
251
- }
252
- }
253
-
254
- &:first-child {
255
- margin-top: 14px;
256
- }
257
-
258
- &:last-child {
259
- margin-bottom: 14px;
260
- }
261
- }
227
+ }
262
228
 
263
- &:first-child {
264
- margin-top: 14px;
265
- }
229
+ .rotate-button {
230
+ display: flex;
231
+ align-items: center;
232
+ justify-content: center;
233
+ padding: 0 !important;
234
+ white-space: initial;
235
+ line-height: 1;
236
+ gap: 5px;
266
237
 
267
- &:last-child {
268
- margin-bottom: 14px;
269
- }
270
- }
271
- }
238
+ .button-content {
239
+ display: flex;
240
+ align-items: center;
241
+ justify-content: center;
272
242
 
273
- .smart-split {
274
- .switch {
275
- .control-label {
276
- .switch-text {
277
- font-size: 14px;
278
- padding-right: 10px;
279
- color: $grey-dark;
280
- font-weight: 500;
243
+ .button-text {
244
+ font-size: 16px;
245
+ max-width: 70%;
281
246
  }
282
247
  }
283
-
284
- .new-badge {
285
- background: linear-gradient(90deg, #c1ff79 0%, #79fff7 100%);
286
- border-radius: 36px;
287
- font-weight: 700;
288
- font-size: 11px;
289
- padding: 5px;
290
- color: $text-color;
291
- }
292
248
  }
293
249
  }
294
250
  }
@@ -472,45 +428,4 @@
472
428
  }
473
429
  }
474
430
  }
475
-
476
- .confirmation-modal-container {
477
- .edit-confirmation-modal {
478
- .header {
479
- display: flex;
480
- align-items: center;
481
- gap: 8px;
482
- padding-bottom: 15px;
483
- font-weight: 500;
484
- font-size: 18px;
485
- }
486
-
487
- .content {
488
- text-align: left;
489
- font-weight: 400;
490
- font-size: 14px;
491
- color: $grey-blue;
492
- }
493
-
494
- .modal-card-foot {
495
- display: flex;
496
- gap: 5px;
497
-
498
- .recommended {
499
- font-weight: 600;
500
- font-size: 11px;
501
- background-color: rgba(255, 255, 255, 0.2);
502
- padding: 2px 5px;
503
- border-radius: 36px;
504
- }
505
-
506
- .button {
507
- width: 100%;
508
-
509
- &.is-primary {
510
- font-weight: 500;
511
- }
512
- }
513
- }
514
- }
515
- }
516
431
  }