@pipelex/mthds-ui 0.42.0 → 0.44.0
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/{chunk-HPARBH6K.js → chunk-5E3UJI2I.js} +43 -12
- package/dist/chunk-5E3UJI2I.js.map +1 -0
- package/dist/graph/index.js +1 -1
- package/dist/graph/react/index.d.ts +33 -4
- package/dist/graph/react/index.js +20 -6
- package/dist/graph/react/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/standalone/graph-standalone.html +136 -133
- package/dist/standalone/graph-viewer.css +1 -1
- package/dist/standalone/graph-viewer.js +135 -132
- package/package.json +2 -2
- package/dist/chunk-HPARBH6K.js.map +0 -1
|
@@ -1077,25 +1077,56 @@ function pipeRefOf(node) {
|
|
|
1077
1077
|
return makePipeRef(node.domain_code, node.pipe_code);
|
|
1078
1078
|
}
|
|
1079
1079
|
function findStuffByDigest(spec, digest) {
|
|
1080
|
-
var _a, _b
|
|
1080
|
+
var _a, _b;
|
|
1081
1081
|
const consumer = findConsumer(spec, digest);
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
}, producerPipeRef ? { producerPipeRef } : {}), consumer ? { consumer } : {});
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1082
|
+
const produced = findProducer(spec, digest);
|
|
1083
|
+
if (produced) {
|
|
1084
|
+
const producerPipeRef = pipeRefOf(produced.node);
|
|
1085
|
+
return __spreadValues(__spreadValues({
|
|
1086
|
+
item: produced.item
|
|
1087
|
+
}, producerPipeRef ? { producerPipeRef } : {}), consumer ? { consumer } : {});
|
|
1091
1088
|
}
|
|
1092
1089
|
for (const node of spec.nodes) {
|
|
1093
|
-
for (const input of (
|
|
1090
|
+
for (const input of (_b = (_a = node.io) == null ? void 0 : _a.inputs) != null ? _b : []) {
|
|
1094
1091
|
if (input.digest === digest) return __spreadValues({ item: input }, consumer ? { consumer } : {});
|
|
1095
1092
|
}
|
|
1096
1093
|
}
|
|
1097
1094
|
return null;
|
|
1098
1095
|
}
|
|
1096
|
+
function findProducer(spec, digest) {
|
|
1097
|
+
var _a, _b, _c, _d;
|
|
1098
|
+
const listing = [];
|
|
1099
|
+
for (const node of spec.nodes) {
|
|
1100
|
+
const item = (_b = (_a = node.io) == null ? void 0 : _a.outputs) == null ? void 0 : _b.find((output) => output.digest === digest);
|
|
1101
|
+
if (item) listing.push({ node, item });
|
|
1102
|
+
}
|
|
1103
|
+
if (listing.length <= 1) return listing[0];
|
|
1104
|
+
const children = /* @__PURE__ */ new Map();
|
|
1105
|
+
for (const edge of (_c = spec.edges) != null ? _c : []) {
|
|
1106
|
+
if (edge.kind !== "contains") continue;
|
|
1107
|
+
const contained = children.get(edge.source);
|
|
1108
|
+
if (contained) contained.push(edge.target);
|
|
1109
|
+
else children.set(edge.source, [edge.target]);
|
|
1110
|
+
}
|
|
1111
|
+
const listed = new Set(listing.map(({ node }) => node.id));
|
|
1112
|
+
return (_d = listing.find(({ node }) => !containsAnyOf(node.id, children, listed))) != null ? _d : (
|
|
1113
|
+
// A containment cycle, which a valid spec cannot hold: the first listing.
|
|
1114
|
+
listing[0]
|
|
1115
|
+
);
|
|
1116
|
+
}
|
|
1117
|
+
function containsAnyOf(id, children, targets) {
|
|
1118
|
+
var _a, _b;
|
|
1119
|
+
const seen = /* @__PURE__ */ new Set([id]);
|
|
1120
|
+
const pending = [...(_a = children.get(id)) != null ? _a : []];
|
|
1121
|
+
while (pending.length > 0) {
|
|
1122
|
+
const next = pending.pop();
|
|
1123
|
+
if (seen.has(next)) continue;
|
|
1124
|
+
if (targets.has(next)) return true;
|
|
1125
|
+
seen.add(next);
|
|
1126
|
+
pending.push(...(_b = children.get(next)) != null ? _b : []);
|
|
1127
|
+
}
|
|
1128
|
+
return false;
|
|
1129
|
+
}
|
|
1099
1130
|
function findConsumer(spec, digest) {
|
|
1100
1131
|
var _a, _b;
|
|
1101
1132
|
for (const node of spec.nodes) {
|
|
@@ -2869,4 +2900,4 @@ export {
|
|
|
2869
2900
|
applySimpleFrames,
|
|
2870
2901
|
GRAPH_STYLE_PIPELINES
|
|
2871
2902
|
};
|
|
2872
|
-
//# sourceMappingURL=chunk-
|
|
2903
|
+
//# sourceMappingURL=chunk-5E3UJI2I.js.map
|