footprint-explainable-ui 0.21.0 → 0.22.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.js CHANGED
@@ -3582,7 +3582,7 @@ var StageNode = memo3(function StageNode2({
3582
3582
  const restingShadow = isHero ? `0 0 10px color-mix(in srgb, ${theme.primary} 22%, transparent)` : `0 2px 8px rgba(0,0,0,0.15)`;
3583
3583
  const bg = active ? theme.primary : done ? theme.success : error ? theme.error : restingBg;
3584
3584
  const borderColor = active ? theme.primary : done ? theme.success : error ? theme.error : restingBorder;
3585
- const shadow = active ? `0 0 16px color-mix(in srgb, ${theme.primary} 40%, transparent)` : done ? `0 0 8px color-mix(in srgb, ${theme.success} 20%, transparent)` : error ? `0 0 12px color-mix(in srgb, ${theme.error} 30%, transparent)` : restingShadow;
3585
+ const shadow = active ? `0 0 22px color-mix(in srgb, ${theme.primary} 55%, transparent)` : done ? `0 0 8px color-mix(in srgb, ${theme.success} 20%, transparent)` : error ? `0 0 12px color-mix(in srgb, ${theme.error} 30%, transparent)` : restingShadow;
3586
3586
  const textColor = active || done || error ? "#fff" : theme.textPrimary;
3587
3587
  return /* @__PURE__ */ jsxs15(Fragment5, { children: [
3588
3588
  /* @__PURE__ */ jsx16(Handle, { type: "target", position: Position.Top, style: { opacity: 0 } }),
@@ -3665,6 +3665,26 @@ var StageNode = memo3(function StageNode2({
3665
3665
  }
3666
3666
  }
3667
3667
  ),
3668
+ active && /* @__PURE__ */ jsx16(
3669
+ "div",
3670
+ {
3671
+ style: {
3672
+ position: "absolute",
3673
+ top: -9,
3674
+ right: -8,
3675
+ zIndex: 11,
3676
+ background: theme.warning,
3677
+ color: "#1a1a1a",
3678
+ fontSize: 9,
3679
+ fontWeight: 800,
3680
+ letterSpacing: 0.6,
3681
+ padding: "2px 6px",
3682
+ borderRadius: 10,
3683
+ boxShadow: `0 0 10px color-mix(in srgb, ${theme.warning} 60%, transparent)`
3684
+ },
3685
+ children: "NOW"
3686
+ }
3687
+ ),
3668
3688
  isDecider ? /* @__PURE__ */ jsxs15("div", { style: { position: "relative", width: 120, height: 72 }, children: [
3669
3689
  /* @__PURE__ */ jsx16(
3670
3690
  "div",
@@ -3924,10 +3944,9 @@ function aggregateMountStatus(slice, graph, currentSubflowId) {
3924
3944
  const members = graph.nodes.filter((n) => n.data?.subflowOf === sfId);
3925
3945
  if (members.length === 0) continue;
3926
3946
  const anyActive = members.some((m) => m.id === slice.activeStageId);
3927
- const anyDone = members.some((m) => slice.doneStageIds.has(m.id));
3928
3947
  const allDone = members.every((m) => slice.doneStageIds.has(m.id));
3929
3948
  if (allDone) doneIds.add(mount.id);
3930
- else if ((anyActive || anyDone) && currentSubflowId === null) {
3949
+ else if (anyActive && currentSubflowId === null) {
3931
3950
  activeId = mount.id;
3932
3951
  }
3933
3952
  }
@@ -3970,6 +3989,7 @@ import { useEffect as useEffect8 } from "react";
3970
3989
  function useChartAutoRefit(wrapperRef, rfInstance, options = {}) {
3971
3990
  const duration = options.duration ?? 200;
3972
3991
  const padding2 = options.padding ?? 0.1;
3992
+ const refitKey = options.refitKey;
3973
3993
  useEffect8(() => {
3974
3994
  const el = wrapperRef.current;
3975
3995
  if (!el || !rfInstance) return;
@@ -3989,6 +4009,19 @@ function useChartAutoRefit(wrapperRef, rfInstance, options = {}) {
3989
4009
  cancelAnimationFrame(raf);
3990
4010
  };
3991
4011
  }, [rfInstance, wrapperRef, duration, padding2]);
4012
+ useEffect8(() => {
4013
+ if (!rfInstance) return;
4014
+ let raf2 = 0;
4015
+ const raf1 = requestAnimationFrame(() => {
4016
+ raf2 = requestAnimationFrame(() => {
4017
+ rfInstance.fitView({ duration, padding: padding2 });
4018
+ });
4019
+ });
4020
+ return () => {
4021
+ cancelAnimationFrame(raf1);
4022
+ cancelAnimationFrame(raf2);
4023
+ };
4024
+ }, [rfInstance, refitKey, duration, padding2]);
3992
4025
  }
3993
4026
 
3994
4027
  // src/components/FlowchartView/SubflowBreadcrumbBar.tsx
@@ -4314,6 +4347,19 @@ function wrapInMainChartBox(graph, opts) {
4314
4347
 
4315
4348
  // src/components/LoopBackEdge/LoopBackEdge.tsx
4316
4349
  import { jsx as jsx19 } from "react/jsx-runtime";
4350
+ var LOOP_DASH = "5 5";
4351
+ var LOOP_STROKE_OPACITY_CAP = 0.55;
4352
+ var LOOP_STROKE_WIDTH = 1.5;
4353
+ function softenLoopStyle(style) {
4354
+ const passedStrokeOpacity = typeof style?.strokeOpacity === "number" ? style.strokeOpacity : 1;
4355
+ return {
4356
+ ...style,
4357
+ strokeDasharray: style?.strokeDasharray ?? LOOP_DASH,
4358
+ strokeOpacity: Math.min(passedStrokeOpacity, LOOP_STROKE_OPACITY_CAP),
4359
+ strokeWidth: LOOP_STROKE_WIDTH
4360
+ };
4361
+ }
4362
+ var LOOP_CORNER_RADIUS = 28;
4317
4363
  function rightEdge(node) {
4318
4364
  return node.internals.positionAbsolute.x + (node.measured.width ?? 0);
4319
4365
  }
@@ -4334,11 +4380,21 @@ function LoopBackEdge({ id, source, target, markerEnd, style }) {
4334
4380
  return loopBackPath(
4335
4381
  { right: rightEdge(src), centerY: centerY(src) },
4336
4382
  { right: rightEdge(tgt), centerY: centerY(tgt) },
4337
- laneX
4383
+ laneX,
4384
+ LOOP_CORNER_RADIUS
4338
4385
  );
4339
4386
  });
4340
4387
  if (!path) return null;
4341
- return /* @__PURE__ */ jsx19(BaseEdge, { id, path, markerEnd, style, "aria-label": "Loop back" });
4388
+ return /* @__PURE__ */ jsx19(
4389
+ BaseEdge,
4390
+ {
4391
+ id,
4392
+ path,
4393
+ markerEnd,
4394
+ style: softenLoopStyle(style),
4395
+ "aria-label": "Loop back"
4396
+ }
4397
+ );
4342
4398
  }
4343
4399
 
4344
4400
  // src/components/SmartStepEdge/SmartStepEdge.tsx
@@ -4631,7 +4687,7 @@ function TracedFlow({
4631
4687
  );
4632
4688
  const wrapperRef = useRef8(null);
4633
4689
  const [rfInstance, setRfInstance] = useState10(null);
4634
- useChartAutoRefit(wrapperRef, rfInstance);
4690
+ useChartAutoRefit(wrapperRef, rfInstance, { refitKey: drill.currentSubflowId });
4635
4691
  return /* @__PURE__ */ jsxs18(
4636
4692
  "div",
4637
4693
  {