@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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeHandles.d.ts","sourceRoot":"","sources":["../../../../src/misc/NodeHandles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,aAAa,EACb,cAAyC,EACzC,eAA0C,EAC1C,YAAY,EACZ,WAAW,EACX,cAA4F,GAC7F,EAAE;IACD,IAAI,EAAE,UAAU,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QACpB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;QACzB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;KAC3B,KAAK,MAAM,GAAG,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QACnB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;QACzB,EAAE,EAAE,MAAM,CAAC;KACZ,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,
|
|
1
|
+
{"version":3,"file":"NodeHandles.d.ts","sourceRoot":"","sources":["../../../../src/misc/NodeHandles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,aAAa,EACb,cAAyC,EACzC,eAA0C,EAC1C,YAAY,EACZ,WAAW,EACX,cAA4F,GAC7F,EAAE;IACD,IAAI,EAAE,UAAU,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QACpB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;QACzB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;KAC3B,KAAK,MAAM,GAAG,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QACnB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;QACzB,EAAE,EAAE,MAAM,CAAC;KACZ,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,2CA8FA;AAED,eAAe,WAAW,CAAC"}
|
package/lib/esm/index.js
CHANGED
|
@@ -1956,12 +1956,20 @@ function NodeHandles({ data, isConnectable, inputClassName = "!w-2 !h-2 !bg-gray
|
|
|
1956
1956
|
const byId = React.useMemo(() => {
|
|
1957
1957
|
const m = new Map();
|
|
1958
1958
|
for (const h of layout) {
|
|
1959
|
-
|
|
1959
|
+
// Prefer namespaced key to disambiguate inputs/outputs that share id
|
|
1960
|
+
m.set(`${h.type}:${h.id}`, {
|
|
1961
|
+
position: h.position,
|
|
1962
|
+
y: h.y,
|
|
1963
|
+
type: h.type,
|
|
1964
|
+
});
|
|
1965
|
+
// Back-compat: also store by id-only if not already set
|
|
1966
|
+
if (!m.has(h.id))
|
|
1967
|
+
m.set(h.id, { position: h.position, y: h.y, type: h.type });
|
|
1960
1968
|
}
|
|
1961
1969
|
return m;
|
|
1962
1970
|
}, [layout]);
|
|
1963
1971
|
return (jsxs(Fragment, { children: [(data.inputHandles ?? []).map((h) => {
|
|
1964
|
-
const placed = byId.get(h.id);
|
|
1972
|
+
const placed = byId.get(`target:${h.id}`) ?? byId.get(h.id);
|
|
1965
1973
|
const position = placed?.position ?? Position.Left;
|
|
1966
1974
|
const y = placed?.y;
|
|
1967
1975
|
const cls = getClassName?.({ kind: "input", id: h.id, type: "target" }) ??
|
|
@@ -1974,7 +1982,7 @@ function NodeHandles({ data, isConnectable, inputClassName = "!w-2 !h-2 !bg-gray
|
|
|
1974
1982
|
textOverflow: "ellipsis",
|
|
1975
1983
|
}, children: renderLabel({ kind: "input", id: h.id }) }))] }, h.id));
|
|
1976
1984
|
}), (data.outputHandles ?? []).map((h) => {
|
|
1977
|
-
const placed = byId.get(h.id);
|
|
1985
|
+
const placed = byId.get(`source:${h.id}`) ?? byId.get(h.id);
|
|
1978
1986
|
const position = placed?.position ?? Position.Right;
|
|
1979
1987
|
const y = placed?.y;
|
|
1980
1988
|
const cls = getClassName?.({ kind: "output", id: h.id, type: "source" }) ??
|