@bian-womp/spark-workbench 0.2.7 → 0.2.8

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/lib/cjs/index.cjs CHANGED
@@ -1958,12 +1958,20 @@ function NodeHandles({ data, isConnectable, inputClassName = "!w-2 !h-2 !bg-gray
1958
1958
  const byId = React.useMemo(() => {
1959
1959
  const m = new Map();
1960
1960
  for (const h of layout) {
1961
- m.set(h.id, { position: h.position, y: h.y, type: h.type });
1961
+ // Prefer namespaced key to disambiguate inputs/outputs that share id
1962
+ m.set(`${h.type}:${h.id}`, {
1963
+ position: h.position,
1964
+ y: h.y,
1965
+ type: h.type,
1966
+ });
1967
+ // Back-compat: also store by id-only if not already set
1968
+ if (!m.has(h.id))
1969
+ m.set(h.id, { position: h.position, y: h.y, type: h.type });
1962
1970
  }
1963
1971
  return m;
1964
1972
  }, [layout]);
1965
1973
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(data.inputHandles ?? []).map((h) => {
1966
- const placed = byId.get(h.id);
1974
+ const placed = byId.get(`target:${h.id}`) ?? byId.get(h.id);
1967
1975
  const position = placed?.position ?? react.Position.Left;
1968
1976
  const y = placed?.y;
1969
1977
  const cls = getClassName?.({ kind: "input", id: h.id, type: "target" }) ??
@@ -1976,7 +1984,7 @@ function NodeHandles({ data, isConnectable, inputClassName = "!w-2 !h-2 !bg-gray
1976
1984
  textOverflow: "ellipsis",
1977
1985
  }, children: renderLabel({ kind: "input", id: h.id }) }))] }, h.id));
1978
1986
  }), (data.outputHandles ?? []).map((h) => {
1979
- const placed = byId.get(h.id);
1987
+ const placed = byId.get(`source:${h.id}`) ?? byId.get(h.id);
1980
1988
  const position = placed?.position ?? react.Position.Right;
1981
1989
  const y = placed?.y;
1982
1990
  const cls = getClassName?.({ kind: "output", id: h.id, type: "source" }) ??