@platforma-sdk/ui-vue 1.42.5 → 1.42.10

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": "@platforma-sdk/ui-vue",
3
- "version": "1.42.5",
3
+ "version": "1.42.10",
4
4
  "type": "module",
5
5
  "main": "dist/lib.js",
6
6
  "styles": "dist/lib.js",
@@ -25,9 +25,9 @@
25
25
  "@vueuse/integrations": "^13.3.0",
26
26
  "d3-format": "^3.1.0",
27
27
  "zod": "~3.23.8",
28
- "@milaboratories/uikit": "2.3.27",
29
- "@milaboratories/biowasm-tools": "^1.1.0",
30
- "@platforma-sdk/model": "~1.42.4"
28
+ "@platforma-sdk/model": "~1.42.10",
29
+ "@milaboratories/uikit": "2.3.29",
30
+ "@milaboratories/biowasm-tools": "^1.1.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "happy-dom": "^15.11.7",
@@ -43,8 +43,8 @@
43
43
  "yarpm": "^1.2.0",
44
44
  "fast-json-patch": "^3.1.1",
45
45
  "@faker-js/faker": "^9.2.0",
46
- "@milaboratories/ts-configs": "1.0.5",
47
46
  "@milaboratories/build-configs": "1.0.5",
47
+ "@milaboratories/ts-configs": "1.0.5",
48
48
  "@milaboratories/eslint-config": "^1.0.4",
49
49
  "@milaboratories/helpers": "^1.6.19"
50
50
  },
@@ -20,7 +20,7 @@ class FileContentData {
20
20
  private _str: string | undefined = undefined;
21
21
  private _rawJson: unknown | undefined = undefined;
22
22
  private _zodSchema: ZodSchema | undefined = undefined;
23
- private _validatedJson: unknown | undefined = undefined;
23
+ private _validatedJson: Zod.SafeParseReturnType<unknown, unknown> | undefined = undefined;
24
24
 
25
25
  constructor(public readonly bytes: Uint8Array) {}
26
26
 
@@ -34,12 +34,12 @@ class FileContentData {
34
34
  return this._rawJson;
35
35
  }
36
36
 
37
- public validatedJson<T>(schema: ZodSchema<T>): T {
37
+ public validatedJson<T>(schema: ZodSchema<T>): T | undefined {
38
38
  if (this._zodSchema !== schema) {
39
- this._validatedJson = schema.parse(this.rawJson);
39
+ this._validatedJson = schema.safeParse(this.rawJson);
40
40
  this._zodSchema = schema;
41
41
  }
42
- return this._validatedJson as T;
42
+ return this._validatedJson?.success ? (this._validatedJson.data as T) : undefined;
43
43
  }
44
44
  }
45
45
 
@@ -67,11 +67,23 @@ export class ReactiveFileContent {
67
67
 
68
68
  // Initiating actual fetch from the cache, that will in turn initiate upload
69
69
  (async () => {
70
- try {
71
- const data = await this.fileDataCache.fetch(handle);
72
- newRef.value = data;
73
- } catch (err: unknown) {
74
- console.error(err);
70
+ const maxRetries = 4;
71
+ const retryDelay = 1000; // 1 second
72
+
73
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
74
+ try {
75
+ const data = await this.fileDataCache.fetch(handle);
76
+ newRef.value = data;
77
+ return;
78
+ } catch (err: unknown) {
79
+ console.error(`File download attempt ${attempt + 1}/${maxRetries} failed:`, err);
80
+
81
+ if (attempt < maxRetries - 1) {
82
+ await new Promise((resolve) => setTimeout(resolve, retryDelay));
83
+ } else {
84
+ console.error(`Failed to download file after ${maxRetries} attempts`);
85
+ }
86
+ }
75
87
  }
76
88
  })();
77
89
 
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpandTransition.vue.js","sources":["../../../../../../../../../lib/ui/uikit/src/components/PlAccordion/ExpandTransition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nconst onStart = (el: Element) => {\n el.classList.add('expand-collapse-fix');\n (el as HTMLElement).style.setProperty('--component-height', el.scrollHeight + 'px');\n};\n\nconst onAfter = (el: Element) => {\n (el as HTMLElement).style.removeProperty('--component-height');\n el.classList.remove('expand-collapse-fix');\n};\n</script>\n\n<template>\n <Transition name=\"expand-collapse\" @enter=\"onStart\" @leave=\"onStart\" @after-enter=\"onAfter\" @after-leave=\"onAfter\">\n <slot/>\n </Transition>\n</template>\n\n<style>\n.expand-collapse-fix {\n overflow: hidden;\n}\n\n.expand-collapse-enter-active,\n.expand-collapse-leave-active {\n transition:\n height 0.2s ease-in-out,\n opacity 0.2s ease-in-out;\n height: var(--component-height);\n}\n\n.expand-collapse-enter-from,\n.expand-collapse-leave-to {\n opacity: 0.5;\n height: 0;\n}\n</style>\n"],"names":["onStart","el","onAfter"],"mappings":";;;;AACMA,UAAAA,IAAU,CAACC,MAAgB;AAC5BA,QAAA,UAAU,IAAI,qBAAqB,GACrCA,EAAmB,MAAM,YAAY,sBAAsBA,EAAG,eAAe,IAAI;AAAA,IAAA,GAG9EC,IAAU,CAACD,MAAgB;AAC9BA,QAAmB,MAAM,eAAe,oBAAoB,GAC1DA,EAAA,UAAU,OAAO,qBAAqB;AAAA,IAC3C;;;;;;;;;;;;;;;"}