@mastra/playground-ui 3.0.0-alpha.4 → 4.0.0-alpha.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.
package/dist/index.es.js CHANGED
@@ -7944,10 +7944,10 @@ function WorkflowTrigger({
7944
7944
  }, [isWatchingWorkflow]);
7945
7945
  useEffect(() => {
7946
7946
  if (!watchResultToUse?.activePaths || !result?.runId) return;
7947
- const suspended = watchResultToUse.activePaths.filter((path) => watchResultToUse.context?.steps?.[path.stepId]?.status === "suspended").map((path) => ({
7948
- stepId: path.stepId,
7947
+ const suspended = Object.entries(watchResultToUse.activePaths).filter(([_, { status }]) => status === "suspended").map(([stepId, { suspendPayload }]) => ({
7948
+ stepId,
7949
7949
  runId: result.runId,
7950
- suspendPayload: watchResultToUse.context?.steps?.[path.stepId]?.suspendPayload
7950
+ suspendPayload
7951
7951
  }));
7952
7952
  setSuspendedSteps(suspended);
7953
7953
  }, [watchResultToUse, result]);
@@ -8010,31 +8010,20 @@ function WorkflowTrigger({
8010
8010
  }
8011
8011
  )
8012
8012
  ] }),
8013
- workflowActivePaths.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
8013
+ Object.values(workflowActivePaths).length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
8014
8014
  /* @__PURE__ */ jsx(Text, { variant: "secondary", className: "px-4 text-mastra-el-3", size: "xs", children: "Status" }),
8015
- /* @__PURE__ */ jsx("div", { className: "px-4", children: workflowActivePaths?.map((activePath, idx) => {
8016
- return /* @__PURE__ */ jsx("div", { className: "flex flex-col mt-2 overflow-hidden border", children: activePath?.stepPath?.map((sp, idx2) => {
8017
- const status = activePath?.status === "completed" ? "Completed" : sp === activePath?.stepId ? activePath?.status.charAt(0).toUpperCase() + activePath?.status.slice(1) : "Completed";
8015
+ /* @__PURE__ */ jsx("div", { className: "px-4 flex flex-col gap-4", children: Object.entries(workflowActivePaths)?.map(([stepId, { status: pathStatus, stepPath }]) => {
8016
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1", children: stepPath?.map((path, idx) => {
8017
+ const status = pathStatus === "completed" ? "Completed" : stepId === path ? pathStatus.charAt(0).toUpperCase() + pathStatus.slice(1) : "Completed";
8018
8018
  const statusIcon = status === "Completed" ? /* @__PURE__ */ jsx("div", { className: "w-2 h-2 bg-green-500 rounded-full" }) : /* @__PURE__ */ jsx("div", { className: "w-2 h-2 bg-yellow-500 rounded-full animate-pulse" });
8019
- return /* @__PURE__ */ jsxs(
8020
- "div",
8021
- {
8022
- className: `
8023
- flex items-center justify-between p-3
8024
- ${idx2 !== activePath.stepPath.length - 1 ? "border-b" : ""}
8025
- bg-white/5
8026
- `,
8027
- children: [
8028
- /* @__PURE__ */ jsx(Text, { variant: "secondary", className: "text-mastra-el-3", size: "xs", children: sp.charAt(0).toUpperCase() + sp.slice(1) }),
8029
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
8030
- /* @__PURE__ */ jsx(Text, { variant: "secondary", className: "text-mastra-el-3", size: "xs", children: statusIcon }),
8031
- status
8032
- ] })
8033
- ]
8034
- },
8035
- idx2
8036
- );
8037
- }) }, idx);
8019
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col overflow-hidden border", children: /* @__PURE__ */ jsxs("div", { className: `flex items-center justify-between p-3`, children: [
8020
+ /* @__PURE__ */ jsx(Text, { variant: "secondary", className: "text-mastra-el-3", size: "xs", children: path.charAt(0).toUpperCase() + path.slice(1) }),
8021
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
8022
+ /* @__PURE__ */ jsx(Text, { variant: "secondary", className: "text-mastra-el-3", size: "xs", children: statusIcon }),
8023
+ status
8024
+ ] })
8025
+ ] }) }, idx);
8026
+ }) });
8038
8027
  }) })
8039
8028
  ] }),
8040
8029
  isSuspendedSteps && suspendedSteps?.map((step) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col px-4", children: [
@@ -8042,7 +8031,7 @@ function WorkflowTrigger({
8042
8031
  step.suspendPayload && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
8043
8032
  CodeBlockDemo,
8044
8033
  {
8045
- className: "w-[300px] overflow-x-auto",
8034
+ className: "w-[300px] overflow-x-auto p-2",
8046
8035
  code: JSON.stringify(step.suspendPayload, null, 2),
8047
8036
  language: "json"
8048
8037
  }