footprint-explainable-ui 0.8.2 → 0.9.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/index.cjs CHANGED
@@ -3796,28 +3796,39 @@ var VLinePill = (0, import_react19.memo)(function VLinePill2({
3796
3796
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { flex: 1, width: 1, background: theme.border } })
3797
3797
  ] });
3798
3798
  });
3799
- var RIGHT_PANEL_LABELS = {
3800
- memory: "Memory",
3801
- narrative: "Narrative"
3802
- };
3803
3799
  var DetailsContent = (0, import_react19.memo)(function DetailsContent2({
3804
3800
  snapshots,
3805
3801
  selectedIndex,
3806
3802
  narrativeEntries,
3807
3803
  narrative,
3808
3804
  size,
3809
- fillHeight
3805
+ fillHeight,
3806
+ extraViews
3810
3807
  }) {
3811
- const [rightPanel, setRightPanel] = (0, import_react19.useState)("memory");
3808
+ const builtInViews = [
3809
+ {
3810
+ id: "memory",
3811
+ name: "Memory",
3812
+ render: ({ snapshots: snaps, selectedIndex: idx }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MemoryPanel, { snapshots: snaps, selectedIndex: idx, size, style: fillHeight ? { height: "100%" } : void 0 })
3813
+ },
3814
+ {
3815
+ id: "narrative",
3816
+ name: "Narrative",
3817
+ render: ({ snapshots: snaps, selectedIndex: idx }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(NarrativePanel, { snapshots: snaps, selectedIndex: idx, narrativeEntries, narrative, size, style: fillHeight ? { height: "100%" } : void 0 })
3818
+ }
3819
+ ];
3820
+ const allViews = [...builtInViews, ...extraViews ?? []];
3821
+ const [activeViewId, setActiveViewId] = (0, import_react19.useState)(allViews[0]?.id ?? "memory");
3822
+ const activeView = allViews.find((v2) => v2.id === activeViewId) ?? allViews[0];
3812
3823
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
3813
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: "flex", borderBottom: `1px solid ${theme.border}`, flexShrink: 0 }, children: ["memory", "narrative"].map((panel) => {
3814
- const active = rightPanel === panel;
3824
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: "flex", borderBottom: `1px solid ${theme.border}`, flexShrink: 0, overflowX: "auto" }, children: allViews.map((view) => {
3825
+ const active = view.id === activeViewId;
3815
3826
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3816
3827
  "button",
3817
3828
  {
3818
- onClick: () => setRightPanel(panel),
3829
+ onClick: () => setActiveViewId(view.id),
3819
3830
  style: {
3820
- flex: 1,
3831
+ flex: allViews.length <= 3 ? 1 : void 0,
3821
3832
  padding: "6px 8px",
3822
3833
  fontSize: 11,
3823
3834
  fontWeight: active ? 600 : 400,
@@ -3828,17 +3839,15 @@ var DetailsContent = (0, import_react19.memo)(function DetailsContent2({
3828
3839
  cursor: "pointer",
3829
3840
  textTransform: "uppercase",
3830
3841
  letterSpacing: "0.06em",
3831
- fontFamily: "inherit"
3842
+ fontFamily: "inherit",
3843
+ whiteSpace: "nowrap"
3832
3844
  },
3833
- children: RIGHT_PANEL_LABELS[panel]
3845
+ children: view.name
3834
3846
  },
3835
- panel
3847
+ view.id
3836
3848
  );
3837
3849
  }) }),
3838
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { flex: 1, overflow: "auto" }, children: [
3839
- rightPanel === "memory" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MemoryPanel, { snapshots, selectedIndex, size, style: fillHeight ? { height: "100%" } : void 0 }),
3840
- rightPanel === "narrative" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(NarrativePanel, { snapshots, selectedIndex, narrativeEntries, narrative, size, style: fillHeight ? { height: "100%" } : void 0 })
3841
- ] })
3850
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { flex: 1, overflow: "auto" }, children: activeView?.render({ snapshots, selectedIndex }) })
3842
3851
  ] });
3843
3852
  });
3844
3853
  function resolveSubflowLevel(parentSpec, parentSnapshots, subflowNodeName, narrativeEntries) {
@@ -3922,6 +3931,7 @@ function ExplainableShell({
3922
3931
  hideConsole = false,
3923
3932
  panelLabels,
3924
3933
  defaultExpanded,
3934
+ recorderViews,
3925
3935
  renderFlowchart,
3926
3936
  size = "default",
3927
3937
  unstyled = false,
@@ -4192,7 +4202,8 @@ function ExplainableShell({
4192
4202
  selectedIndex: safeIdx,
4193
4203
  narrativeEntries: activeNarrativeEntries,
4194
4204
  narrative: activeNarrative,
4195
- size
4205
+ size,
4206
+ extraViews: recorderViews
4196
4207
  }
4197
4208
  ) }),
4198
4209
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(HLinePill, { label: bottomLabel, detail: `${activeSnapshots.length} stages`, expanded: timelineExpanded, onClick: toggleTimeline }),
@@ -4230,7 +4241,8 @@ function ExplainableShell({
4230
4241
  narrativeEntries: activeNarrativeEntries,
4231
4242
  narrative: activeNarrative,
4232
4243
  size,
4233
- fillHeight: true
4244
+ fillHeight: true,
4245
+ extraViews: recorderViews
4234
4246
  }
4235
4247
  )
4236
4248
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(VLinePill, { label: rightLabel, expanded: false, onClick: () => toggleRight(true) })