@veritree/ui 0.16.2 → 0.16.5

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": "@veritree/ui",
3
- "version": "0.16.2",
3
+ "version": "0.16.5",
4
4
  "description": "veritree ui library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -28,9 +28,9 @@
28
28
 
29
29
  <script>
30
30
  export default {
31
- name: "VTDrawerContent",
31
+ name: 'VTDrawerContent',
32
32
 
33
- inject: ["api"],
33
+ inject: ['api'],
34
34
 
35
35
  data() {
36
36
  return {
@@ -52,23 +52,27 @@ export default {
52
52
  },
53
53
 
54
54
  activeClass() {
55
- return "transform transition duration-300 ease-in-out";
55
+ return 'transform transition duration-300 ease-in-out';
56
56
  },
57
57
 
58
58
  enterClass() {
59
- return `opacity-0 ${this.right ? "" : "-"}translate-x-full`;
59
+ return `opacity-0 ${
60
+ this.right ? 'translate-x-full' : '-translate-x-full'
61
+ }`;
60
62
  },
61
63
 
62
64
  enterToClass() {
63
- return `opacity-100 ${this.right ? "-" : ""}translate-x-0`;
65
+ return `opacity-100 ${this.right ? '-translate-x-0' : 'translate-x-0'}`;
64
66
  },
65
67
 
66
68
  leaveClass() {
67
- return `opacity-100 ${this.right ? "-" : ""}translate-x-0`;
69
+ return `opacity-100 ${this.right ? '-translate-x-0' : 'translate-x-0'}`;
68
70
  },
69
71
 
70
72
  leaveToClass() {
71
- return `opacity-0 ${this.right ? "" : "-"}translate-x-full`;
73
+ return `opacity-0 ${
74
+ this.right ? 'translate-x-full' : '-translate-x-full'
75
+ }`;
72
76
  },
73
77
  },
74
78
 
@@ -9,15 +9,15 @@
9
9
  </template>
10
10
 
11
11
  <script>
12
- import { handleImageResizing } from "../../utils/images";
12
+ import { handleImageResizing } from '../../utils/images';
13
13
 
14
14
  export default {
15
- name: "VTImage",
15
+ name: 'VTImage',
16
16
 
17
17
  props: {
18
18
  src: {
19
19
  type: String,
20
- default: "",
20
+ default: '',
21
21
  },
22
22
  cdnSrc: {
23
23
  type: [String, Object],
@@ -67,7 +67,7 @@ export default {
67
67
 
68
68
  onError() {
69
69
  this.canLoad = false;
70
- this.$emit("error");
70
+ this.$emit('error');
71
71
  },
72
72
  },
73
73
  };
@@ -3,36 +3,42 @@ export const handleImageResizing = (url, width) => {
3
3
  if (!url) {
4
4
  return '';
5
5
  }
6
-
6
+
7
7
  let cdn;
8
+
9
+ try {
10
+ if (typeof url === 'object') {
11
+ cdn = url.cdn_url;
12
+ }
8
13
 
9
- if (typeof url === 'object') {
10
- cdn = url.cdn_url;
11
- } else if (typeof url === 'string') {
12
- cdn = JSON.parse(url).cdn_url;
13
- }
14
+ if (typeof url === 'string') {
15
+ cdn = JSON.parse(url).cdn_url;
16
+ }
14
17
 
15
- const base64String = cdn.split('net/');
16
- const firstPart = base64String[0];
18
+ const base64String = cdn.split('net/');
19
+ const firstPart = base64String[0];
17
20
 
18
- // if atob is crossed and your editor says is not supported,
19
- // don't worry, it seems to be about NodeJS and not about
20
- // browsers.
21
- //
22
- // Details: https://developer.mozilla.org/en-US/docs/Web/API/atob
23
- const decodedString = JSON.parse(atob(base64String[1]));
21
+ // if atob is crossed and your editor says is not supported,
22
+ // don't worry, it seems to be about NodeJS and not about
23
+ // browsers.
24
+ //
25
+ // Details: https://developer.mozilla.org/en-US/docs/Web/API/atob
26
+ const decodedString = JSON.parse(atob(base64String[1]));
24
27
 
25
- width
26
- ? (decodedString.edits.resize.width = width)
27
- : (decodedString.edits.resize.width = 450);
28
+ width
29
+ ? (decodedString.edits.resize.width = width)
30
+ : (decodedString.edits.resize.width = 450);
28
31
 
29
- // if btoa is crossed and your editor says is not supported,
30
- // don't worry, it seems to be about NodeJS and not about
31
- // browsers.
32
- //
33
- // Details: https://developer.mozilla.org/en-US/docs/Web/API/atob
34
- const encodedString = btoa(JSON.stringify(decodedString));
35
- const encodedUrl = `${firstPart}net/${encodedString}`;
32
+ // if btoa is crossed and your editor says is not supported,
33
+ // don't worry, it seems to be about NodeJS and not about
34
+ // browsers.
35
+ //
36
+ // Details: https://developer.mozilla.org/en-US/docs/Web/API/atob
37
+ const encodedString = btoa(JSON.stringify(decodedString));
38
+ const encodedUrl = `${firstPart}net/${encodedString}`;
36
39
 
37
- return encodedUrl;
40
+ return encodedUrl
41
+ } catch(error) {
42
+ console.error(`${error} in ${cdn}`);
43
+ }
38
44
  };