footprint-explainable-ui 0.11.1 → 0.11.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 +16 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +16 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2433,7 +2433,7 @@ var ENTRY_ICONS = {
|
|
|
2433
2433
|
};
|
|
2434
2434
|
function StoryNarrative({
|
|
2435
2435
|
entries,
|
|
2436
|
-
|
|
2436
|
+
revealedStages,
|
|
2437
2437
|
size = "default",
|
|
2438
2438
|
unstyled = false,
|
|
2439
2439
|
className,
|
|
@@ -2442,15 +2442,15 @@ function StoryNarrative({
|
|
|
2442
2442
|
const fs = fontSize[size];
|
|
2443
2443
|
const pad = padding[size];
|
|
2444
2444
|
const revealedCount = (0, import_react11.useMemo)(() => {
|
|
2445
|
-
let stagesSeen = 0;
|
|
2446
2445
|
for (let i = 0; i < entries.length; i++) {
|
|
2447
2446
|
const e = entries[i];
|
|
2448
|
-
const
|
|
2449
|
-
if (
|
|
2450
|
-
|
|
2447
|
+
const key = e.stageId ?? e.stageName;
|
|
2448
|
+
if (key && !revealedStages.has(key)) {
|
|
2449
|
+
return i;
|
|
2450
|
+
}
|
|
2451
2451
|
}
|
|
2452
2452
|
return entries.length;
|
|
2453
|
-
}, [entries,
|
|
2453
|
+
}, [entries, revealedStages]);
|
|
2454
2454
|
const revealed = entries.slice(0, revealedCount);
|
|
2455
2455
|
const future = entries.slice(revealedCount);
|
|
2456
2456
|
const latestRef = (0, import_react11.useRef)(null);
|
|
@@ -2585,9 +2585,17 @@ function NarrativePanel({
|
|
|
2585
2585
|
const endIdx = groupsToShow < stageBoundaries.length ? stageBoundaries[groupsToShow] : narrative.length;
|
|
2586
2586
|
return Math.max(1, endIdx);
|
|
2587
2587
|
}, [snapshots.length, selectedIndex, narrative]);
|
|
2588
|
+
const revealedStages = (0, import_react12.useMemo)(() => {
|
|
2589
|
+
const labels = /* @__PURE__ */ new Set();
|
|
2590
|
+
for (let i = 0; i <= selectedIndex && i < snapshots.length; i++) {
|
|
2591
|
+
if (snapshots[i].stageLabel) labels.add(snapshots[i].stageLabel);
|
|
2592
|
+
if (snapshots[i].stageName) labels.add(snapshots[i].stageName);
|
|
2593
|
+
}
|
|
2594
|
+
return labels;
|
|
2595
|
+
}, [snapshots, selectedIndex]);
|
|
2588
2596
|
const hasStructured = narrativeEntries && narrativeEntries.length > 0;
|
|
2589
2597
|
if (unstyled) {
|
|
2590
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className, style, "data-fp": "narrative-panel", children: hasStructured ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(StoryNarrative, { entries: narrativeEntries,
|
|
2598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className, style, "data-fp": "narrative-panel", children: hasStructured ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(StoryNarrative, { entries: narrativeEntries, revealedStages, unstyled: true }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NarrativeTrace, { narrative, revealedCount, unstyled: true }) });
|
|
2591
2599
|
}
|
|
2592
2600
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2593
2601
|
"div",
|
|
@@ -2619,7 +2627,7 @@ function NarrativePanel({
|
|
|
2619
2627
|
StoryNarrative,
|
|
2620
2628
|
{
|
|
2621
2629
|
entries: narrativeEntries,
|
|
2622
|
-
|
|
2630
|
+
revealedStages,
|
|
2623
2631
|
size,
|
|
2624
2632
|
style: { flex: 1 }
|
|
2625
2633
|
}
|