@valbuild/ui 0.35.0 → 0.37.0

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.
@@ -60635,9 +60635,9 @@ const Session = z.union([
60635
60635
  z.object({
60636
60636
  id: z.string(),
60637
60637
  mode: z.literal("proxy"),
60638
- full_name: z.string().optional(),
60639
- username: z.string().optional(),
60640
- avatar_url: z.string().url().optional(),
60638
+ full_name: z.string().optional().nullable(),
60639
+ username: z.string().optional().nullable(),
60640
+ avatar_url: z.string().url().optional().nullable(),
60641
60641
  enabled: z.boolean()
60642
60642
  }),
60643
60643
  z.object({
@@ -73709,7 +73709,13 @@ function ValOverlay({
73709
73709
  }
73710
73710
  ) }),
73711
73711
  loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-primary", children: "Loading..." }),
73712
- error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-red", children: error }),
73712
+ error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 py-2 text-red", children: [
73713
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "font-bold", children: [
73714
+ "Error: ",
73715
+ error.message
73716
+ ] }),
73717
+ "details" in error && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "bg-card text-card-foreground", children: error.details })
73718
+ ] }),
73713
73719
  selectedSchema !== void 0 && selectedSource !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
73714
73720
  ValFormField,
73715
73721
  {
@@ -73778,7 +73784,7 @@ function useValModules(api, path) {
73778
73784
  if ((modules == null ? void 0 : modules.status) === "error") {
73779
73785
  return {
73780
73786
  moduleId,
73781
- error: modules.error,
73787
+ error: { message: modules.error },
73782
73788
  selectedSource: void 0,
73783
73789
  selectedSchema: void 0,
73784
73790
  loading: false
@@ -73786,7 +73792,10 @@ function useValModules(api, path) {
73786
73792
  }
73787
73793
  if (!(modules == null ? void 0 : modules.data)) {
73788
73794
  return {
73789
- error: "Not a module: " + moduleId,
73795
+ error: {
73796
+ message: "Val could not fetch data for this element.",
73797
+ details: "Module data not found for: " + moduleId
73798
+ },
73790
73799
  selectedSource: void 0,
73791
73800
  selectedSchema: void 0,
73792
73801
  loading: false
@@ -73801,7 +73810,7 @@ function useValModules(api, path) {
73801
73810
  ...resolvedModulePath.value,
73802
73811
  error: null
73803
73812
  } : {
73804
- error: resolvedModulePath && result.isErr(resolvedModulePath) ? resolvedModulePath.error.message : null,
73813
+ error: resolvedModulePath && result.isErr(resolvedModulePath) ? resolvedModulePath.error : null,
73805
73814
  source: void 0,
73806
73815
  schema: void 0
73807
73816
  };
@@ -73968,6 +73977,7 @@ function useSession(api) {
73968
73977
  }
73969
73978
  }
73970
73979
  } catch (e) {
73980
+ console.error("Could not authorize:", e);
73971
73981
  setSession({
73972
73982
  status: "error",
73973
73983
  error: "Got an error while trying to get session"
@@ -60617,9 +60617,9 @@ const Session = z.union([
60617
60617
  z.object({
60618
60618
  id: z.string(),
60619
60619
  mode: z.literal("proxy"),
60620
- full_name: z.string().optional(),
60621
- username: z.string().optional(),
60622
- avatar_url: z.string().url().optional(),
60620
+ full_name: z.string().optional().nullable(),
60621
+ username: z.string().optional().nullable(),
60622
+ avatar_url: z.string().url().optional().nullable(),
60623
60623
  enabled: z.boolean()
60624
60624
  }),
60625
60625
  z.object({
@@ -73691,7 +73691,13 @@ function ValOverlay({
73691
73691
  }
73692
73692
  ) }),
73693
73693
  loading && /* @__PURE__ */ jsx("div", { className: "text-primary", children: "Loading..." }),
73694
- error && /* @__PURE__ */ jsx("div", { className: "text-red", children: error }),
73694
+ error && /* @__PURE__ */ jsxs("div", { className: "px-4 py-2 text-red", children: [
73695
+ /* @__PURE__ */ jsxs("div", { className: "font-bold", children: [
73696
+ "Error: ",
73697
+ error.message
73698
+ ] }),
73699
+ "details" in error && /* @__PURE__ */ jsx("pre", { className: "bg-card text-card-foreground", children: error.details })
73700
+ ] }),
73695
73701
  selectedSchema !== void 0 && selectedSource !== void 0 && /* @__PURE__ */ jsx(
73696
73702
  ValFormField,
73697
73703
  {
@@ -73760,7 +73766,7 @@ function useValModules(api, path) {
73760
73766
  if ((modules == null ? void 0 : modules.status) === "error") {
73761
73767
  return {
73762
73768
  moduleId,
73763
- error: modules.error,
73769
+ error: { message: modules.error },
73764
73770
  selectedSource: void 0,
73765
73771
  selectedSchema: void 0,
73766
73772
  loading: false
@@ -73768,7 +73774,10 @@ function useValModules(api, path) {
73768
73774
  }
73769
73775
  if (!(modules == null ? void 0 : modules.data)) {
73770
73776
  return {
73771
- error: "Not a module: " + moduleId,
73777
+ error: {
73778
+ message: "Val could not fetch data for this element.",
73779
+ details: "Module data not found for: " + moduleId
73780
+ },
73772
73781
  selectedSource: void 0,
73773
73782
  selectedSchema: void 0,
73774
73783
  loading: false
@@ -73783,7 +73792,7 @@ function useValModules(api, path) {
73783
73792
  ...resolvedModulePath.value,
73784
73793
  error: null
73785
73794
  } : {
73786
- error: resolvedModulePath && result.isErr(resolvedModulePath) ? resolvedModulePath.error.message : null,
73795
+ error: resolvedModulePath && result.isErr(resolvedModulePath) ? resolvedModulePath.error : null,
73787
73796
  source: void 0,
73788
73797
  schema: void 0
73789
73798
  };
@@ -73950,6 +73959,7 @@ function useSession(api) {
73950
73959
  }
73951
73960
  }
73952
73961
  } catch (e) {
73962
+ console.error("Could not authorize:", e);
73953
73963
  setSession({
73954
73964
  status: "error",
73955
73965
  error: "Got an error while trying to get session"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/ui",
3
- "version": "0.35.0",
3
+ "version": "0.37.0",
4
4
  "sideEffects": false,
5
5
  "scripts": {
6
6
  "typecheck": "tsc --noEmit",
@@ -34,8 +34,8 @@
34
34
  "@radix-ui/react-tabs": "^1.0.4",
35
35
  "@radix-ui/react-toggle": "^1.0.3",
36
36
  "@radix-ui/react-tooltip": "^1.0.7",
37
- "@valbuild/core": "~0.35.0",
38
- "@valbuild/shared": "~0.35.0",
37
+ "@valbuild/core": "~0.37.0",
38
+ "@valbuild/shared": "~0.37.0",
39
39
  "class-variance-authority": "^0.7.0",
40
40
  "classnames": "^2.3.2",
41
41
  "clsx": "^2.0.0",