footprint-explainable-ui 0.8.1 → 0.8.2

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
@@ -3848,8 +3848,9 @@ function resolveSubflowLevel(parentSpec, parentSnapshots, subflowNodeName, narra
3848
3848
  (s) => s.stageName === subflowNodeName || s.stageLabel === subflowNodeName
3849
3849
  );
3850
3850
  if (!parentSnap?.subflowResult) return null;
3851
- const sfNarrativeName = specNode.subflowName ?? specNode.name ?? subflowNodeName;
3852
- const sfNarrative = narrativeEntries ? extractSubflowNarrative(narrativeEntries, sfNarrativeName) : void 0;
3851
+ const sfId = specNode.subflowId ?? subflowNodeName;
3852
+ const sfDisplayName = specNode.subflowName ?? specNode.name;
3853
+ const sfNarrative = narrativeEntries ? extractSubflowNarrative(narrativeEntries, sfId, sfDisplayName) : void 0;
3853
3854
  const sfSnapshots = subflowResultToSnapshots(parentSnap.subflowResult, sfNarrative);
3854
3855
  if (sfSnapshots.length === 0) return null;
3855
3856
  return {
@@ -3859,15 +3860,21 @@ function resolveSubflowLevel(parentSpec, parentSnapshots, subflowNodeName, narra
3859
3860
  snapshots: sfSnapshots
3860
3861
  };
3861
3862
  }
3862
- function extractSubflowNarrative(entries, subflowName) {
3863
+ function extractSubflowNarrative(entries, subflowId, subflowName) {
3864
+ const prefix = subflowId + "/";
3865
+ const byPrefix = entries.filter((e) => e.stageName?.startsWith(prefix));
3866
+ if (byPrefix.length > 0) return byPrefix;
3867
+ const byId = entries.filter((e) => e.subflowId === subflowId);
3868
+ if (byId.length > 0) return byId;
3863
3869
  const result = [];
3870
+ const searchName = subflowName ?? subflowId;
3864
3871
  let inside = false;
3865
3872
  for (const entry of entries) {
3866
- if (entry.type === "subflow" && entry.text.includes(subflowName) && entry.text.startsWith("Entering")) {
3873
+ if (entry.type === "subflow" && entry.text.includes(searchName) && entry.text.startsWith("Entering")) {
3867
3874
  inside = true;
3868
3875
  continue;
3869
3876
  }
3870
- if (inside && entry.type === "subflow" && entry.text.includes(subflowName) && entry.text.startsWith("Exiting")) break;
3877
+ if (inside && entry.type === "subflow" && entry.text.includes(searchName) && entry.text.startsWith("Exiting")) break;
3871
3878
  if (inside) result.push(entry);
3872
3879
  }
3873
3880
  return result;