@particle-academy/fancy-flow 0.26.0 → 0.27.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.cjs CHANGED
@@ -11265,8 +11265,9 @@ function collectInputs(node, incoming, portValues, initial) {
11265
11265
  const inputs = { ...initial[node.id] ?? {} };
11266
11266
  for (const e of incoming) {
11267
11267
  const portId = e.targetHandle ?? "in";
11268
- const val = portValues.get(`${e.source}:${e.sourceHandle ?? "out"}`);
11269
- inputs[portId] = val;
11268
+ const key = `${e.source}:${e.sourceHandle ?? "out"}`;
11269
+ if (!portValues.has(key)) continue;
11270
+ inputs[portId] = portValues.get(key);
11270
11271
  }
11271
11272
  return inputs;
11272
11273
  }
@@ -13161,9 +13162,13 @@ function NodeConfigPanel({
13161
13162
  return /* @__PURE__ */ jsxRuntime.jsxs("aside", { className: ["ff-panel", className ?? ""].filter(Boolean).join(" "), style: style2, children: [
13162
13163
  header,
13163
13164
  /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "ff-panel__header", children: [
13164
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-panel__kind-tag", children: kind.label }),
13165
- kind.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ff-panel__kind-desc", children: kind.description })
13165
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-panel__head-icon", style: { background: kind.accent ?? categoryAccent(kind.category) }, "aria-hidden": true, children: kind.icon }),
13166
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ff-panel__head-text", children: [
13167
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-panel__head-kind", children: kind.label }),
13168
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-panel__head-name", children: node.data.label || kind.label })
13169
+ ] })
13166
13170
  ] }),
13171
+ kind.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ff-panel__kind-desc", children: kind.description }),
13167
13172
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ff-panel__field", children: [
13168
13173
  /* @__PURE__ */ jsxRuntime.jsx("label", { className: "ff-panel__label", children: "Label" }),
13169
13174
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -13238,17 +13243,29 @@ function FlowRunControls({ running, onRun, onCancel, onReset, className, style:
13238
13243
  onReset && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "ff-run-controls__btn ff-run-controls__btn--reset", onClick: onReset, disabled: running, children: "Reset" })
13239
13244
  ] });
13240
13245
  }
13241
- function FlowRunFeed({ entries, className, style: style2 }) {
13246
+ function FlowRunFeed({ entries, showHeader = true, title = "Run feed", running, className, style: style2 }) {
13242
13247
  const scrollRef = ReactExports.useRef(null);
13243
13248
  ReactExports.useEffect(() => {
13244
13249
  const el = scrollRef.current;
13245
13250
  if (el) el.scrollTop = el.scrollHeight;
13246
13251
  }, [entries.length]);
13247
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ["ff-run-feed", className ?? ""].filter(Boolean).join(" "), style: style2, ref: scrollRef, children: entries.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ff-run-feed__empty", children: "No run events yet." }) : entries.map((e) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `ff-run-feed__row ff-run-feed__row--${e.level}`, children: [
13248
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-run-feed__time", children: formatTime(e.at) }),
13249
- e.nodeId && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-run-feed__node", children: e.nodeId }),
13250
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-run-feed__text", children: e.text })
13251
- ] }, e.id)) });
13252
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ["ff-run-feed", className ?? ""].filter(Boolean).join(" "), style: style2, children: [
13253
+ showHeader && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ff-run-feed__header", children: [
13254
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-run-feed__title", "aria-hidden": true, children: "\u25B8" }),
13255
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-run-feed__title-text", children: title }),
13256
+ running && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-run-feed__badge", children: "running" }),
13257
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ff-run-feed__count", children: [
13258
+ entries.length,
13259
+ " ",
13260
+ entries.length === 1 ? "event" : "events"
13261
+ ] })
13262
+ ] }),
13263
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ff-run-feed__body", ref: scrollRef, children: entries.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ff-run-feed__empty", children: "No run events yet." }) : entries.map((e) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `ff-run-feed__row ff-run-feed__row--${e.level}`, children: [
13264
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-run-feed__time", children: formatTime(e.at) }),
13265
+ e.nodeId && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-run-feed__node", children: e.nodeId }),
13266
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-run-feed__text", children: e.text })
13267
+ ] }, e.id)) })
13268
+ ] });
13252
13269
  }
13253
13270
  function formatTime(at2) {
13254
13271
  const d = new Date(at2);
@@ -14493,7 +14510,7 @@ function FlowEditorInner({
14493
14510
  onCancel: () => setLabelEdit(null)
14494
14511
  }
14495
14512
  ),
14496
- showFeed && (slots.feed ? slots.feed(api) : /* @__PURE__ */ jsxRuntime.jsx(FlowRunFeed, { entries: runner.feed, className: "ff-editor__feed" })),
14513
+ showFeed && (slots.feed ? slots.feed(api) : /* @__PURE__ */ jsxRuntime.jsx(FlowRunFeed, { entries: runner.feed, running: api.running, className: "ff-editor__feed" })),
14497
14514
  prompt && /* @__PURE__ */ jsxRuntime.jsx(HumanPrompt, { request: prompt, onCancel: () => {
14498
14515
  setPrompt(null);
14499
14516
  runner.cancel();