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

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.1.51-dev.1",
3
+ "version": "0.1.51",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -129,6 +129,12 @@ export default {
129
129
  required: false,
130
130
  default: "false",
131
131
  },
132
+ // eslint-disable-next-line vue/prop-name-casing
133
+ annotation_content_width: {
134
+ type: String,
135
+ required: false,
136
+ default: "60",
137
+ },
132
138
  },
133
139
  computed: {
134
140
  ...mapState("display", ["pageError"]),
@@ -258,6 +264,13 @@ export default {
258
264
  return this.hide_empty_label_sets === "true";
259
265
  }
260
266
  },
267
+ annotationContentWidth() {
268
+ if (process.env.VUE_APP_ANNOTATION_CONTENT_WIDTH) {
269
+ return process.env.VUE_APP_ANNOTATION_CONTENT_WIDTH;
270
+ } else {
271
+ return this.annotation_content_width;
272
+ }
273
+ },
261
274
  },
262
275
  async created() {
263
276
  // Sentry config
@@ -305,6 +318,10 @@ export default {
305
318
  // document and project config
306
319
  Promise.all([
307
320
  this.$store.dispatch("display/setDetailsUrl", this.detailsUrl),
321
+ this.$store.dispatch(
322
+ "display/setAnnotationWidth",
323
+ this.annotationContentWidth
324
+ ),
308
325
  this.$store.dispatch(
309
326
  "display/hideEmptyLabelSets",
310
327
  this.hideEmptyLabelSets
@@ -156,26 +156,28 @@ export default {
156
156
  return elementsWidth;
157
157
  },
158
158
  onDocumentResize() {
159
- this.documentContainerLeftPadding =
160
- this.$refs.scrollingDocument.$el.getBoundingClientRect().left;
161
- this.documentContainerWidth =
162
- this.$refs.scrollingDocument.$el.offsetWidth;
163
- this.$store.dispatch(
164
- "display/updateOptimalResolution",
165
- this.$el.offsetWidth
166
- );
167
- if (this.selectedDocument.pages[0]) {
168
- this.$store.dispatch("display/updateScale", {
169
- elementsWidth: this.elementsWidth(),
170
- client: {
171
- width: this.$el.clientWidth,
172
- height: this.$el.clientHeight,
173
- },
174
- viewport: {
175
- width: this.selectedDocument.pages[0].size[0],
176
- height: this.selectedDocument.pages[0].size[1],
177
- },
178
- });
159
+ if (this.$refs.scrollingDocument) {
160
+ this.documentContainerLeftPadding =
161
+ this.$refs.scrollingDocument.$el.getBoundingClientRect().left;
162
+ this.documentContainerWidth =
163
+ this.$refs.scrollingDocument.$el.offsetWidth;
164
+ this.$store.dispatch(
165
+ "display/updateOptimalResolution",
166
+ this.$el.offsetWidth
167
+ );
168
+ if (this.selectedDocument.pages[0]) {
169
+ this.$store.dispatch("display/updateScale", {
170
+ elementsWidth: this.elementsWidth(),
171
+ client: {
172
+ width: this.$el.clientWidth,
173
+ height: this.$el.clientHeight,
174
+ },
175
+ viewport: {
176
+ width: this.selectedDocument.pages[0].size[0],
177
+ height: this.selectedDocument.pages[0].size[1],
178
+ },
179
+ });
180
+ }
179
181
  }
180
182
  },
181
183
  },
package/src/main.js CHANGED
@@ -8,6 +8,11 @@ import VueObserveVisibility from "vue-observe-visibility";
8
8
  import Icons from "./icons";
9
9
  import VueSplit from "vue-split-panel";
10
10
 
11
+ // Log app version
12
+ console.log(
13
+ `${require("../package.json").name} ${require("../package.json").version}`
14
+ );
15
+
11
16
  Vue.component("VueFontawesome", Icons);
12
17
  Vue.component("App", App);
13
18
  Vue.use(VueKonva);
@@ -316,6 +316,16 @@ const actions = {
316
316
  commit("SET_LABEL_WIDTH", value);
317
317
  commit("SET_ANNOTATION_WIDTH", 100 - value);
318
318
  },
319
+ setAnnotationWidth: ({ commit }, value) => {
320
+ const width = Number(value);
321
+ if (width && width >= 20) {
322
+ commit("SET_ANNOTATION_WIDTH", width);
323
+ commit("SET_LABEL_WIDTH", 100 - width);
324
+ } else {
325
+ commit("SET_ANNOTATION_WIDTH", 60);
326
+ commit("SET_LABEL_WIDTH", 40);
327
+ }
328
+ },
319
329
 
320
330
  debounceSearch: debounce(({ commit, dispatch }, query) => {
321
331
  dispatch("search", query);