@valbuild/ui 0.47.0 → 0.47.1

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.
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Val</title>
7
- <script type="module" crossorigin src="/api/val/static/assets/index-8U9B2Ocg.js"></script>
8
- <link rel="stylesheet" crossorigin href="/api/val/static/assets/index-0Qeyj20F.css">
7
+ <script type="module" crossorigin src="/api/val/static/assets/index-P3ucL9Mc.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/api/val/static/assets/index-7FeUbHhm.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
@@ -64246,11 +64246,13 @@ function ValMenu({
64246
64246
  /* @__PURE__ */ jsxRuntimeExports.jsx(
64247
64247
  MenuButton,
64248
64248
  {
64249
- active: editMode === "hover",
64249
+ active: editMode === "hover" || editMode === "window",
64250
64250
  onClick: () => {
64251
- setEditMode((prev) => prev === "hover" ? "off" : "hover");
64251
+ setEditMode(
64252
+ (prev) => prev === "hover" || editMode === "window" ? "off" : "hover"
64253
+ );
64252
64254
  },
64253
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-[24px] w-[24px] flex justify-center items-center", children: editMode === "hover" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Pause, { size: 18 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Play, { size: 18 }) })
64255
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-[24px] w-[24px] flex justify-center items-center", children: editMode === "hover" || editMode === "window" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Pause, { size: 18 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Play, { size: 18 }) })
64254
64256
  }
64255
64257
  ),
64256
64258
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -77210,6 +77212,16 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77210
77212
  },
77211
77213
  []
77212
77214
  );
77215
+ const allModuleIds = Object.entries(modules || {}).flatMap(
77216
+ ([moduleId, valModule]) => {
77217
+ if ((valModule == null ? void 0 : valModule.schema) && (valModule == null ? void 0 : valModule.source)) {
77218
+ return [moduleId];
77219
+ } else if (valModule == null ? void 0 : valModule.errors) {
77220
+ return [moduleId];
77221
+ }
77222
+ return [];
77223
+ }
77224
+ );
77213
77225
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
77214
77226
  ValOverlayContext.Provider,
77215
77227
  {
@@ -77256,7 +77268,7 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77256
77268
  PathTree,
77257
77269
  {
77258
77270
  selectedPath,
77259
- paths: Object.keys(modules),
77271
+ paths: allModuleIds,
77260
77272
  setSelectedModuleId: (path) => {
77261
77273
  navigate(path);
77262
77274
  }
@@ -77287,7 +77299,8 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77287
77299
  "ERROR: ",
77288
77300
  error
77289
77301
  ] }),
77290
- modules && selectedPath && selectedModuleId && moduleSource !== void 0 && moduleSchema !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(ValModulesContext.Provider, { value: modules, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
77302
+ session.status === "success" && session.data.mode === "unauthorized" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-xl p-4 text-lg bg-destructive text-destructive-foreground", children: "Not authorized" }),
77303
+ session.status === "success" && session.data.mode !== "unauthorized" && modules && selectedPath && selectedModuleId && moduleSource !== void 0 && moduleSchema !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(ValModulesContext.Provider, { value: modules, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
77291
77304
  ValModule,
77292
77305
  {
77293
77306
  path: selectedPath,
@@ -64245,11 +64245,13 @@ function ValMenu({
64245
64245
  /* @__PURE__ */ jsxRuntimeExports.jsx(
64246
64246
  MenuButton,
64247
64247
  {
64248
- active: editMode === "hover",
64248
+ active: editMode === "hover" || editMode === "window",
64249
64249
  onClick: () => {
64250
- setEditMode((prev) => prev === "hover" ? "off" : "hover");
64250
+ setEditMode(
64251
+ (prev) => prev === "hover" || editMode === "window" ? "off" : "hover"
64252
+ );
64251
64253
  },
64252
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-[24px] w-[24px] flex justify-center items-center", children: editMode === "hover" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Pause, { size: 18 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Play, { size: 18 }) })
64254
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-[24px] w-[24px] flex justify-center items-center", children: editMode === "hover" || editMode === "window" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Pause, { size: 18 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Play, { size: 18 }) })
64253
64255
  }
64254
64256
  ),
64255
64257
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -77211,6 +77213,16 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77211
77213
  },
77212
77214
  []
77213
77215
  );
77216
+ const allModuleIds = Object.entries(modules || {}).flatMap(
77217
+ ([moduleId, valModule]) => {
77218
+ if ((valModule == null ? void 0 : valModule.schema) && (valModule == null ? void 0 : valModule.source)) {
77219
+ return [moduleId];
77220
+ } else if (valModule == null ? void 0 : valModule.errors) {
77221
+ return [moduleId];
77222
+ }
77223
+ return [];
77224
+ }
77225
+ );
77214
77226
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
77215
77227
  ValOverlayContext.Provider,
77216
77228
  {
@@ -77257,7 +77269,7 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77257
77269
  PathTree,
77258
77270
  {
77259
77271
  selectedPath,
77260
- paths: Object.keys(modules),
77272
+ paths: allModuleIds,
77261
77273
  setSelectedModuleId: (path) => {
77262
77274
  navigate(path);
77263
77275
  }
@@ -77288,7 +77300,8 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77288
77300
  "ERROR: ",
77289
77301
  error
77290
77302
  ] }),
77291
- modules && selectedPath && selectedModuleId && moduleSource !== void 0 && moduleSchema !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(ValModulesContext.Provider, { value: modules, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
77303
+ session.status === "success" && session.data.mode === "unauthorized" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-xl p-4 text-lg bg-destructive text-destructive-foreground", children: "Not authorized" }),
77304
+ session.status === "success" && session.data.mode !== "unauthorized" && modules && selectedPath && selectedModuleId && moduleSource !== void 0 && moduleSchema !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(ValModulesContext.Provider, { value: modules, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
77292
77305
  ValModule,
77293
77306
  {
77294
77307
  path: selectedPath,