footprint-explainable-ui 0.11.4 → 0.11.5
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 +60 -81
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +60 -81
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2458,28 +2458,20 @@ function StoryNarrative({
|
|
|
2458
2458
|
}, [entries, revealedStages]);
|
|
2459
2459
|
const revealed = (0, import_react11.useMemo)(() => {
|
|
2460
2460
|
const raw = entries.slice(0, revealedCount);
|
|
2461
|
-
|
|
2462
|
-
const groups = /* @__PURE__ */ new Map();
|
|
2463
|
-
const groupOrder = [];
|
|
2464
|
-
for (const e of raw) {
|
|
2461
|
+
return raw.filter((e) => {
|
|
2465
2462
|
const sfId = e.subflowId;
|
|
2466
|
-
if (sfId)
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
}
|
|
2476
|
-
const result = [...root];
|
|
2477
|
-
for (const sfId of groupOrder) {
|
|
2478
|
-
result.push(...groups.get(sfId));
|
|
2463
|
+
if (!sfId && e.type !== "subflow") return true;
|
|
2464
|
+
return false;
|
|
2465
|
+
});
|
|
2466
|
+
}, [entries, revealedCount]);
|
|
2467
|
+
const futureCount = (0, import_react11.useMemo)(() => {
|
|
2468
|
+
let count = 0;
|
|
2469
|
+
for (let i = revealedCount; i < entries.length; i++) {
|
|
2470
|
+
const e = entries[i];
|
|
2471
|
+
if (!e.subflowId && entries[i].type !== "subflow") count++;
|
|
2479
2472
|
}
|
|
2480
|
-
return
|
|
2473
|
+
return count;
|
|
2481
2474
|
}, [entries, revealedCount]);
|
|
2482
|
-
const future = entries.slice(revealedCount);
|
|
2483
2475
|
const latestRef = (0, import_react11.useRef)(null);
|
|
2484
2476
|
(0, import_react11.useEffect)(() => {
|
|
2485
2477
|
latestRef.current?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
@@ -2508,76 +2500,63 @@ function StoryNarrative({
|
|
|
2508
2500
|
const isDecision = entry.type === "condition";
|
|
2509
2501
|
const isError = entry.type === "error";
|
|
2510
2502
|
const isLast = i === revealed.length - 1;
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
fontSize: isStage ? fs.body : fs.small,
|
|
2558
|
-
fontWeight: isStage ? 600 : 400,
|
|
2559
|
-
color: isError ? theme.error : isDecision ? theme.warning : isStage ? theme.textPrimary : theme.textSecondary,
|
|
2560
|
-
lineHeight: 1.6,
|
|
2561
|
-
fontFamily: entry.type === "step" ? theme.fontMono : theme.fontSans
|
|
2562
|
-
},
|
|
2563
|
-
children: entry.text
|
|
2564
|
-
}
|
|
2565
|
-
)
|
|
2566
|
-
]
|
|
2567
|
-
}
|
|
2568
|
-
)
|
|
2569
|
-
] }, i);
|
|
2503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2504
|
+
"div",
|
|
2505
|
+
{
|
|
2506
|
+
ref: isLast ? latestRef : void 0,
|
|
2507
|
+
style: {
|
|
2508
|
+
display: "flex",
|
|
2509
|
+
gap: 8,
|
|
2510
|
+
padding: isStage ? `${pad - 4}px 0` : `2px 0`,
|
|
2511
|
+
marginLeft: entry.depth * 16,
|
|
2512
|
+
borderBottom: isStage ? `1px solid ${theme.border}` : void 0,
|
|
2513
|
+
marginTop: isStage && i > 0 ? 8 : 0
|
|
2514
|
+
},
|
|
2515
|
+
children: [
|
|
2516
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2517
|
+
"span",
|
|
2518
|
+
{
|
|
2519
|
+
style: {
|
|
2520
|
+
color: meta.color,
|
|
2521
|
+
fontWeight: 700,
|
|
2522
|
+
fontSize: isStage ? fs.body : fs.small,
|
|
2523
|
+
width: 16,
|
|
2524
|
+
textAlign: "center",
|
|
2525
|
+
flexShrink: 0
|
|
2526
|
+
},
|
|
2527
|
+
title: meta.label,
|
|
2528
|
+
"aria-label": meta.label,
|
|
2529
|
+
children: meta.icon
|
|
2530
|
+
}
|
|
2531
|
+
),
|
|
2532
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2533
|
+
"span",
|
|
2534
|
+
{
|
|
2535
|
+
style: {
|
|
2536
|
+
fontSize: isStage ? fs.body : fs.small,
|
|
2537
|
+
fontWeight: isStage ? 600 : 400,
|
|
2538
|
+
color: isError ? theme.error : isDecision ? theme.warning : isStage ? theme.textPrimary : theme.textSecondary,
|
|
2539
|
+
lineHeight: 1.6,
|
|
2540
|
+
fontFamily: entry.type === "step" ? theme.fontMono : theme.fontSans
|
|
2541
|
+
},
|
|
2542
|
+
children: entry.text
|
|
2543
|
+
}
|
|
2544
|
+
)
|
|
2545
|
+
]
|
|
2546
|
+
},
|
|
2547
|
+
i
|
|
2548
|
+
);
|
|
2570
2549
|
}),
|
|
2571
|
-
|
|
2550
|
+
futureCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: {
|
|
2572
2551
|
opacity: 0.3,
|
|
2573
2552
|
fontSize: fs.small,
|
|
2574
2553
|
color: theme.textMuted,
|
|
2575
2554
|
padding: `8px 0`,
|
|
2576
2555
|
fontStyle: "italic"
|
|
2577
2556
|
}, children: [
|
|
2578
|
-
|
|
2557
|
+
futureCount,
|
|
2579
2558
|
" more ",
|
|
2580
|
-
|
|
2559
|
+
futureCount === 1 ? "entry" : "entries",
|
|
2581
2560
|
" ahead..."
|
|
2582
2561
|
] })
|
|
2583
2562
|
]
|