@qodalis/react-cli 2.0.0-beta.12 → 2.0.0-beta.13

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/dist/index.js CHANGED
@@ -333,7 +333,7 @@ var CliPanel = import_react5.default.forwardRef(
333
333
  const [statusServerState, setStatusServerState] = (0, import_react5.useState)("none");
334
334
  const [statusServerDetails, setStatusServerDetails] = (0, import_react5.useState)([]);
335
335
  const [statusUptime, setStatusUptime] = (0, import_react5.useState)(0);
336
- const [statusText, setStatusText] = (0, import_react5.useState)(null);
336
+ const [notification, setNotification] = (0, import_react5.useState)(null);
337
337
  const [servicesDropdownOpen, setServicesDropdownOpen] = (0, import_react5.useState)(false);
338
338
  const [serversDropdownOpen, setServersDropdownOpen] = (0, import_react5.useState)(false);
339
339
  const servicesDropdownRef = (0, import_react5.useRef)(null);
@@ -586,8 +586,8 @@ var CliPanel = import_react5.default.forwardRef(
586
586
  setStatusExecutionState(running ? "running" : "idle");
587
587
  const result = context.lastCommandResult;
588
588
  setStatusLastCommand(result ? { name: result.command, success: result.success } : null);
589
- const text = context.getStatusText?.();
590
- setStatusText(text || null);
589
+ const notif = context.notifier?.current;
590
+ setNotification(notif || null);
591
591
  }, 300);
592
592
  const pollGlobal = setInterval(() => {
593
593
  const tab = tabs.find((t) => t.id === activeTabIdRef.current);
@@ -911,7 +911,41 @@ var CliPanel = import_react5.default.forwardRef(
911
911
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cli-panel-status-icon", children: "\u2191" }),
912
912
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cli-panel-status-label", children: formattedUptime })
913
913
  ] }),
914
- statusText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cli-panel-status-item status-text", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cli-panel-status-label", children: statusText }) })
914
+ notification && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: `cli-panel-status-item status-text level-${notification.level}`, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cli-panel-status-label", children: notification.message }) })
915
+ ] }),
916
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "cli-panel-status-indicators-compact", children: [
917
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cli-panel-status-compact-item", title: statusExecutionState, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: `cli-panel-status-dot ${statusExecutionState === "running" ? "dot-running" : "dot-idle"}` }) }),
918
+ statusServiceCount.total > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
919
+ "span",
920
+ {
921
+ ref: servicesDropdownRef,
922
+ className: "cli-panel-status-compact-item status-clickable",
923
+ title: `${statusServiceCount.running}/${statusServiceCount.total} services`,
924
+ onClick: (e) => {
925
+ e.stopPropagation();
926
+ setServicesDropdownOpen((prev) => !prev);
927
+ setServersDropdownOpen(false);
928
+ },
929
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cli-panel-status-icon", children: "\u2699" })
930
+ }
931
+ ),
932
+ statusLastCommand && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cli-panel-status-compact-item", title: `${statusLastCommand.success ? "\u2713" : "\u2717"} ${statusLastCommand.name}`, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: `cli-panel-status-icon ${statusLastCommand.success ? "status-success" : "status-error"}`, children: statusLastCommand.success ? "\u2713" : "\u2717" }) }),
933
+ statusServerState !== "none" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
934
+ "span",
935
+ {
936
+ ref: serversDropdownRef,
937
+ className: "cli-panel-status-compact-item status-clickable",
938
+ title: `${statusServerDetails.filter((s) => s.connected).length}/${statusServerDetails.length} servers`,
939
+ onClick: (e) => {
940
+ e.stopPropagation();
941
+ setServersDropdownOpen((prev) => !prev);
942
+ setServicesDropdownOpen(false);
943
+ },
944
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: `cli-panel-status-dot ${statusServerState === "connected" ? "dot-idle" : "dot-error"}` })
945
+ }
946
+ ),
947
+ statusUptime > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cli-panel-status-compact-item status-muted", title: formattedUptime, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cli-panel-status-icon", children: "\u2191" }) }),
948
+ notification && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cli-panel-status-compact-item", title: notification.message, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: `cli-panel-status-compact-dot level-${notification.level}` }) })
915
949
  ] }),
916
950
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "cli-panel-action-buttons", children: [
917
951
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "cli-panel-btn-position-wrapper", onClick: (e) => e.stopPropagation(), children: [
@@ -1106,7 +1140,17 @@ var CliPanel = import_react5.default.forwardRef(
1106
1140
  const el = servicesDropdownRef.current;
1107
1141
  if (!el) return {};
1108
1142
  const rect = el.getBoundingClientRect();
1109
- return position === "top" ? { position: "fixed", top: rect.bottom + 4, left: rect.left, zIndex: 1100 } : { position: "fixed", bottom: window.innerHeight - rect.top + 4, left: rect.left, zIndex: 1100 };
1143
+ const base = { position: "fixed", zIndex: 1100 };
1144
+ switch (position) {
1145
+ case "top":
1146
+ return { ...base, top: rect.bottom + 4, left: rect.left };
1147
+ case "left":
1148
+ return { ...base, top: rect.top, left: rect.right + 4 };
1149
+ case "right":
1150
+ return { ...base, top: rect.top, right: window.innerWidth - rect.left + 4 };
1151
+ default:
1152
+ return { ...base, bottom: window.innerHeight - rect.top + 4, left: rect.left };
1153
+ }
1110
1154
  })(),
1111
1155
  onClick: (e) => e.stopPropagation(),
1112
1156
  children: [
@@ -1131,7 +1175,17 @@ var CliPanel = import_react5.default.forwardRef(
1131
1175
  const el = serversDropdownRef.current;
1132
1176
  if (!el) return {};
1133
1177
  const rect = el.getBoundingClientRect();
1134
- return position === "top" ? { position: "fixed", top: rect.bottom + 4, left: rect.left, zIndex: 1100 } : { position: "fixed", bottom: window.innerHeight - rect.top + 4, left: rect.left, zIndex: 1100 };
1178
+ const base = { position: "fixed", zIndex: 1100 };
1179
+ switch (position) {
1180
+ case "top":
1181
+ return { ...base, top: rect.bottom + 4, left: rect.left };
1182
+ case "left":
1183
+ return { ...base, top: rect.top, left: rect.right + 4 };
1184
+ case "right":
1185
+ return { ...base, top: rect.top, right: window.innerWidth - rect.left + 4 };
1186
+ default:
1187
+ return { ...base, bottom: window.innerHeight - rect.top + 4, left: rect.left };
1188
+ }
1135
1189
  })(),
1136
1190
  onClick: (e) => e.stopPropagation(),
1137
1191
  children: [