@cjlapao/ui-kit 0.2.5 → 0.2.6
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 +283 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +91 -2
- package/dist/index.d.ts +91 -2
- package/dist/index.js +280 -36
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +14 -2
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.js +14 -2
- package/dist/markdown.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15764,12 +15764,23 @@ var ScrollArea = ({
|
|
|
15764
15764
|
mask = false,
|
|
15765
15765
|
tabIndex = 0,
|
|
15766
15766
|
contentClassName,
|
|
15767
|
+
viewportClassName,
|
|
15768
|
+
viewportRef: viewportRefProp,
|
|
15767
15769
|
children,
|
|
15768
15770
|
className = "",
|
|
15769
15771
|
...rest
|
|
15770
15772
|
}) => {
|
|
15771
15773
|
const viewportId = useId7();
|
|
15772
15774
|
const viewportRef = useRef9(null);
|
|
15775
|
+
const setViewportRef = useCallback4(
|
|
15776
|
+
(el) => {
|
|
15777
|
+
viewportRef.current = el;
|
|
15778
|
+
if (typeof viewportRefProp === "function") viewportRefProp(el);
|
|
15779
|
+
else if (viewportRefProp)
|
|
15780
|
+
viewportRefProp.current = el;
|
|
15781
|
+
},
|
|
15782
|
+
[viewportRefProp]
|
|
15783
|
+
);
|
|
15773
15784
|
const contentRef = useRef9(null);
|
|
15774
15785
|
const yTrackRef = useRef9(null);
|
|
15775
15786
|
const xTrackRef = useRef9(null);
|
|
@@ -15911,7 +15922,7 @@ var ScrollArea = ({
|
|
|
15911
15922
|
/* @__PURE__ */ jsx182(
|
|
15912
15923
|
"div",
|
|
15913
15924
|
{
|
|
15914
|
-
ref:
|
|
15925
|
+
ref: setViewportRef,
|
|
15915
15926
|
id: viewportId,
|
|
15916
15927
|
"data-slot": "scrollarea-viewport",
|
|
15917
15928
|
tabIndex: overflow.x || overflow.y ? tabIndex : -1,
|
|
@@ -15926,7 +15937,8 @@ var ScrollArea = ({
|
|
|
15926
15937
|
// and the viewport would simply grow past the frame's cap, get
|
|
15927
15938
|
// clipped by `overflow-hidden` and never learn it was scrollable.
|
|
15928
15939
|
"[scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
15929
|
-
"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400"
|
|
15940
|
+
"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400",
|
|
15941
|
+
viewportClassName
|
|
15930
15942
|
),
|
|
15931
15943
|
children: /* @__PURE__ */ jsx182(
|
|
15932
15944
|
"div",
|
|
@@ -55722,6 +55734,7 @@ var CONNECTION_FLOW_EDGE_STYLES = [
|
|
|
55722
55734
|
"curved",
|
|
55723
55735
|
"straight"
|
|
55724
55736
|
];
|
|
55737
|
+
var CONNECTION_FLOW_CHILD_LAYOUTS = ["fan", "chain"];
|
|
55725
55738
|
var CONNECTION_FLOW_LOADERS = [
|
|
55726
55739
|
"skeleton",
|
|
55727
55740
|
"spinner",
|
|
@@ -55860,6 +55873,8 @@ var DEFAULT_LAYOUT_OPTIONS = {
|
|
|
55860
55873
|
laneGap: 16,
|
|
55861
55874
|
childGap: 12,
|
|
55862
55875
|
childIndent: 28,
|
|
55876
|
+
rowGap: 12,
|
|
55877
|
+
gridIndent: 28,
|
|
55863
55878
|
edgeStyle: "orthogonal",
|
|
55864
55879
|
cornerRadius: 8,
|
|
55865
55880
|
bypassLift: 18,
|
|
@@ -55885,6 +55900,8 @@ var NODE_CORNER_RADIUS = Object.fromEntries(
|
|
|
55885
55900
|
var nodeTone = (node) => node?.tone ?? (node?.status ? STATUS_TONE[node.status] : "neutral");
|
|
55886
55901
|
var nodeIcon = (node) => node?.icon ?? (node?.status ? STATUS_ICON2[node.status] : void 0);
|
|
55887
55902
|
var nodeIsActive = (node) => node?.active ?? node?.status === "running";
|
|
55903
|
+
var nodeHasFailed = (node) => node?.status === "failed";
|
|
55904
|
+
var toRows = (node) => node.rows ?? (node.children ?? []).map((child) => [child]);
|
|
55888
55905
|
var nodeIsSkipped = (node) => node?.skipped ?? (node?.status === "skipped" ? true : void 0);
|
|
55889
55906
|
|
|
55890
55907
|
// ../common/connectionFlow/measure.ts
|
|
@@ -55965,6 +55982,15 @@ var nodeScrolls = (node, options, expanded) => {
|
|
|
55965
55982
|
};
|
|
55966
55983
|
var measureBranch = (node, options, expanded) => {
|
|
55967
55984
|
const own = measureNode(node, options, expanded);
|
|
55985
|
+
if (node.childLayout === "chain") {
|
|
55986
|
+
const rows = toRows(node);
|
|
55987
|
+
if (rows.length === 0) return own;
|
|
55988
|
+
const rowsHeight = rows.reduce(
|
|
55989
|
+
(sum, row, index) => sum + Math.max(0, ...row.map((c) => measureBranch(c, options, expanded))) + (index > 0 ? options.rowGap : 0),
|
|
55990
|
+
0
|
|
55991
|
+
);
|
|
55992
|
+
return own + options.childGap + rowsHeight;
|
|
55993
|
+
}
|
|
55968
55994
|
const children = node.children ?? [];
|
|
55969
55995
|
if (children.length === 0) return own;
|
|
55970
55996
|
const childHeight = children.reduce(
|
|
@@ -56360,6 +56386,7 @@ var layoutConnectionFlow = (input) => {
|
|
|
56360
56386
|
const skipped = resolveSkipped(columns, input.autoState ?? false);
|
|
56361
56387
|
const laidOut = [];
|
|
56362
56388
|
const byId = /* @__PURE__ */ new Map();
|
|
56389
|
+
const chains = /* @__PURE__ */ new Map();
|
|
56363
56390
|
let x = options.padding;
|
|
56364
56391
|
const columnBounds = [];
|
|
56365
56392
|
columns.forEach((column, columnIndex) => {
|
|
@@ -56410,15 +56437,68 @@ var layoutConnectionFlow = (input) => {
|
|
|
56410
56437
|
placeChildren(child, depth + 1, indentX + options.childIndent);
|
|
56411
56438
|
});
|
|
56412
56439
|
};
|
|
56413
|
-
|
|
56440
|
+
if (node.childLayout === "chain") {
|
|
56441
|
+
const rows = toRows(node);
|
|
56442
|
+
if (rows.length > 0) {
|
|
56443
|
+
const cardWidth = options.metrics.width;
|
|
56444
|
+
const gridX = x + options.gridIndent;
|
|
56445
|
+
let rowY = y + ownHeight + options.childGap;
|
|
56446
|
+
const walk2 = [];
|
|
56447
|
+
let maxCols = 1;
|
|
56448
|
+
rows.forEach((row, rowIdx) => {
|
|
56449
|
+
maxCols = Math.max(maxCols, row.length);
|
|
56450
|
+
let rowBottom = rowY;
|
|
56451
|
+
row.forEach((card, col) => {
|
|
56452
|
+
const cardHeight = measureNode(card, options, input.expanded);
|
|
56453
|
+
const cardEntry = {
|
|
56454
|
+
id: card.id,
|
|
56455
|
+
node: card,
|
|
56456
|
+
outline: "",
|
|
56457
|
+
x: gridX + col * (cardWidth + options.connectorWidth),
|
|
56458
|
+
y: rowY,
|
|
56459
|
+
width: cardWidth,
|
|
56460
|
+
height: cardHeight,
|
|
56461
|
+
anchorY: cardHeight / 2,
|
|
56462
|
+
column: columnIndex,
|
|
56463
|
+
depth: 1,
|
|
56464
|
+
tone: toneOf(card),
|
|
56465
|
+
scrollable: nodeScrolls(card, options, input.expanded)
|
|
56466
|
+
};
|
|
56467
|
+
laidOut.push(cardEntry);
|
|
56468
|
+
byId.set(card.id, cardEntry);
|
|
56469
|
+
walk2.push({ card: cardEntry, row: rowIdx });
|
|
56470
|
+
rowBottom = Math.max(rowBottom, rowY + cardHeight);
|
|
56471
|
+
});
|
|
56472
|
+
rowY = rowBottom + options.rowGap;
|
|
56473
|
+
});
|
|
56474
|
+
const live = walk2.filter((w) => !nodeIsSkipped(w.card.node));
|
|
56475
|
+
const exitCard = live.length > 0 ? live[live.length - 1].card : null;
|
|
56476
|
+
chains.set(node.id, {
|
|
56477
|
+
parentNode: node,
|
|
56478
|
+
walk: walk2,
|
|
56479
|
+
exitCard,
|
|
56480
|
+
exitHasBranch: Boolean(exitCard?.node.success?.to),
|
|
56481
|
+
gridWidth: options.gridIndent + maxCols * cardWidth + (maxCols - 1) * options.connectorWidth
|
|
56482
|
+
});
|
|
56483
|
+
} else {
|
|
56484
|
+
placeChildren(node, 1, x + options.childIndent);
|
|
56485
|
+
}
|
|
56486
|
+
} else {
|
|
56487
|
+
placeChildren(node, 1, x + options.childIndent);
|
|
56488
|
+
}
|
|
56414
56489
|
y += heights[laneIndex] + options.laneGap;
|
|
56415
56490
|
});
|
|
56491
|
+
const chainInfo = column.parallel ? void 0 : chains.get(column.nodes[0].id);
|
|
56492
|
+
const columnWidth = Math.max(
|
|
56493
|
+
options.metrics.width,
|
|
56494
|
+
chainInfo?.gridWidth ?? 0
|
|
56495
|
+
);
|
|
56416
56496
|
columnBounds.push({
|
|
56417
56497
|
start: x,
|
|
56418
|
-
end: x +
|
|
56498
|
+
end: x + columnWidth,
|
|
56419
56499
|
centre: options.padding + stackHeight / 2
|
|
56420
56500
|
});
|
|
56421
|
-
x +=
|
|
56501
|
+
x += columnWidth + options.connectorWidth;
|
|
56422
56502
|
});
|
|
56423
56503
|
const edges = [];
|
|
56424
56504
|
const connectors = /* @__PURE__ */ new Map();
|
|
@@ -56476,7 +56556,10 @@ var layoutConnectionFlow = (input) => {
|
|
|
56476
56556
|
if (columnIsTerminal(sourceIndex)) return;
|
|
56477
56557
|
if (skipped.has(columnIndex)) return;
|
|
56478
56558
|
const isBypass = sourceIndex !== columnIndex - 1;
|
|
56479
|
-
const
|
|
56559
|
+
const chainSrc = columns[sourceIndex].parallel ? void 0 : chains.get(columns[sourceIndex].nodes[0].id);
|
|
56560
|
+
if (chainSrc && (!chainSrc.exitCard || chainSrc.exitHasBranch)) return;
|
|
56561
|
+
if (chainSrc?.exitCard?.node.terminal === true) return;
|
|
56562
|
+
const sourceNodes = chainSrc?.exitCard ? [chainSrc.exitCard.node] : columns[sourceIndex].nodes;
|
|
56480
56563
|
const targetNodes = column.nodes;
|
|
56481
56564
|
const state = (sourceNode, targetNode) => targetNode.connector?.state ?? (input.autoState ? toneOf(sourceNode) !== "neutral" ? nodeIsActive(targetNode) ? "flowing" : "stopped" : "disabled" : input.flowState ?? "flowing");
|
|
56482
56565
|
const animatedFor = (cfg, edgeState) => (cfg?.animated ?? input.animated ?? true) && (edgeState === "flowing" || edgeState === "stopped" && (cfg?.animateCompleted ?? false));
|
|
@@ -56486,7 +56569,7 @@ var layoutConnectionFlow = (input) => {
|
|
|
56486
56569
|
labelUsed = true;
|
|
56487
56570
|
return label;
|
|
56488
56571
|
};
|
|
56489
|
-
const sourceSpan = columnBox(sourceIndex);
|
|
56572
|
+
const sourceSpan = chainSrc?.exitCard ? boxOf(chainSrc.exitCard) : columnBox(sourceIndex);
|
|
56490
56573
|
const targetSpan = columnBox(columnIndex);
|
|
56491
56574
|
if (!sourceSpan || !targetSpan) return;
|
|
56492
56575
|
const sides = selectSides(sourceSpan, targetSpan);
|
|
@@ -56570,6 +56653,7 @@ var layoutConnectionFlow = (input) => {
|
|
|
56570
56653
|
});
|
|
56571
56654
|
});
|
|
56572
56655
|
const childEdges = (parent) => {
|
|
56656
|
+
if (parent.childLayout === "chain") return;
|
|
56573
56657
|
const parentEntry = byId.get(parent.id);
|
|
56574
56658
|
if (!parentEntry) return;
|
|
56575
56659
|
(parent.children ?? []).forEach((child) => {
|
|
@@ -56631,6 +56715,146 @@ var layoutConnectionFlow = (input) => {
|
|
|
56631
56715
|
});
|
|
56632
56716
|
};
|
|
56633
56717
|
input.nodes.forEach(childEdges);
|
|
56718
|
+
const emitFlowEdge = (o) => {
|
|
56719
|
+
const route = routePorts(o.fromPort, o.toPort, {
|
|
56720
|
+
style: o.cfg?.edgeStyle ?? options.edgeStyle,
|
|
56721
|
+
stub: Math.min(18, options.connectorWidth / 3),
|
|
56722
|
+
radius: options.cornerRadius,
|
|
56723
|
+
trim: trimFor(o.cfg),
|
|
56724
|
+
via: o.via
|
|
56725
|
+
});
|
|
56726
|
+
const animated = (o.cfg?.animated ?? input.animated ?? true) && (o.state === "flowing" || o.state === "stopped" && (o.cfg?.animateCompleted ?? false));
|
|
56727
|
+
addConnector(o.fromEntry.id, o.fromPort, o.sourceTone, o.state, animated, o.id, o.cfg);
|
|
56728
|
+
addConnector(o.toEntry.id, o.toPort, o.targetTone, o.state, animated, o.id, o.cfg);
|
|
56729
|
+
edges.push({
|
|
56730
|
+
id: o.id,
|
|
56731
|
+
fromId: o.fromEntry.id,
|
|
56732
|
+
toId: o.toEntry.id,
|
|
56733
|
+
state: o.state,
|
|
56734
|
+
points: route.points,
|
|
56735
|
+
d: route.d,
|
|
56736
|
+
sourceTone: o.sourceTone,
|
|
56737
|
+
targetTone: o.targetTone,
|
|
56738
|
+
bypass: false,
|
|
56739
|
+
emitIndex: 0,
|
|
56740
|
+
emitCount: 1,
|
|
56741
|
+
emitSpan: 0,
|
|
56742
|
+
animated,
|
|
56743
|
+
label: o.label,
|
|
56744
|
+
kind: o.kind,
|
|
56745
|
+
branchKind: o.branchKind
|
|
56746
|
+
});
|
|
56747
|
+
};
|
|
56748
|
+
const sidePort = (entry, side) => port(boxOf(entry), side, entry.anchorY / entry.height);
|
|
56749
|
+
const branchToneOf = (branch, kind) => branch.tone ?? (kind === "success" ? STATUS_TONE.succeeded : STATUS_TONE.failed);
|
|
56750
|
+
const emitBranch = (fromEntry, branch, kind) => {
|
|
56751
|
+
if (!branch.to) return;
|
|
56752
|
+
const target = byId.get(branch.to);
|
|
56753
|
+
if (!target || target.id === fromEntry.id) return;
|
|
56754
|
+
const tone = branchToneOf(branch, kind);
|
|
56755
|
+
const state = kind === "failure" ? nodeHasFailed(fromEntry.node) ? "flowing" : "stopped" : nodeHasFailed(fromEntry.node) ? "stopped" : "flowing";
|
|
56756
|
+
const srcBox = boxOf(fromEntry);
|
|
56757
|
+
const tgtBox = boxOf(target);
|
|
56758
|
+
const upstream = tgtBox.y + tgtBox.height <= srcBox.y + 1 || tgtBox.x + tgtBox.width <= srcBox.x + 1;
|
|
56759
|
+
if (upstream && kind === "failure") {
|
|
56760
|
+
emitFlowEdge({
|
|
56761
|
+
id: `${fromEntry.id}~fail>${target.id}`,
|
|
56762
|
+
fromEntry,
|
|
56763
|
+
toEntry: target,
|
|
56764
|
+
fromPort: port(srcBox, "left", fromEntry.anchorY / fromEntry.height),
|
|
56765
|
+
toPort: port(tgtBox, "top", 0.5),
|
|
56766
|
+
via: { x: Math.min(srcBox.x, tgtBox.x) - options.bypassLift },
|
|
56767
|
+
state,
|
|
56768
|
+
sourceTone: tone,
|
|
56769
|
+
targetTone: tone,
|
|
56770
|
+
label: branch.label,
|
|
56771
|
+
kind: "branch",
|
|
56772
|
+
branchKind: kind
|
|
56773
|
+
});
|
|
56774
|
+
return;
|
|
56775
|
+
}
|
|
56776
|
+
const sides = selectSides(srcBox, tgtBox);
|
|
56777
|
+
emitFlowEdge({
|
|
56778
|
+
id: `${fromEntry.id}~${kind === "failure" ? "fail" : "ok"}>${target.id}`,
|
|
56779
|
+
fromEntry,
|
|
56780
|
+
toEntry: target,
|
|
56781
|
+
fromPort: sidePort(fromEntry, sides.from),
|
|
56782
|
+
toPort: sidePort(target, sides.to),
|
|
56783
|
+
state,
|
|
56784
|
+
sourceTone: tone,
|
|
56785
|
+
targetTone: tone,
|
|
56786
|
+
label: branch.label,
|
|
56787
|
+
kind: "branch",
|
|
56788
|
+
branchKind: kind
|
|
56789
|
+
});
|
|
56790
|
+
};
|
|
56791
|
+
chains.forEach((chain) => {
|
|
56792
|
+
const parentEntry = byId.get(chain.parentNode.id);
|
|
56793
|
+
if (!parentEntry) return;
|
|
56794
|
+
if (nodeIsSkipped(chain.parentNode) === true) return;
|
|
56795
|
+
const live = chain.walk.filter((w) => !nodeIsSkipped(w.card.node));
|
|
56796
|
+
if (live.length === 0) return;
|
|
56797
|
+
const first = live[0].card;
|
|
56798
|
+
const parentBox = boxOf(parentEntry);
|
|
56799
|
+
const firstBox = boxOf(first);
|
|
56800
|
+
emitFlowEdge({
|
|
56801
|
+
id: `${parentEntry.id}~in>${first.id}`,
|
|
56802
|
+
fromEntry: parentEntry,
|
|
56803
|
+
toEntry: first,
|
|
56804
|
+
fromPort: portAt(
|
|
56805
|
+
parentBox,
|
|
56806
|
+
"bottom",
|
|
56807
|
+
firstBox.x + firstBox.width / 2 - parentBox.x
|
|
56808
|
+
),
|
|
56809
|
+
toPort: port(firstBox, "top", 0.5),
|
|
56810
|
+
state: first.node.connector?.state ?? (nodeHasFailed(parentEntry.node) ? "stopped" : nodeIsActive(first.node) ? "flowing" : "stopped"),
|
|
56811
|
+
sourceTone: toneOf(parentEntry.node),
|
|
56812
|
+
targetTone: toneOf(first.node),
|
|
56813
|
+
cfg: first.node.connector,
|
|
56814
|
+
kind: "chain"
|
|
56815
|
+
});
|
|
56816
|
+
live.forEach((w, i) => {
|
|
56817
|
+
const src = w.card;
|
|
56818
|
+
if (src.node.success?.to) {
|
|
56819
|
+
emitBranch(src, src.node.success, "success");
|
|
56820
|
+
return;
|
|
56821
|
+
}
|
|
56822
|
+
const next = live[i + 1];
|
|
56823
|
+
if (!next) return;
|
|
56824
|
+
const tgt = next.card;
|
|
56825
|
+
const srcBox = boxOf(src);
|
|
56826
|
+
const tgtBox = boxOf(tgt);
|
|
56827
|
+
const sameRow = next.row === w.row;
|
|
56828
|
+
const gapStart = srcBox.x + srcBox.width;
|
|
56829
|
+
const gapEnd = tgtBox.x;
|
|
56830
|
+
emitFlowEdge({
|
|
56831
|
+
id: `${src.id}~walk>${tgt.id}`,
|
|
56832
|
+
fromEntry: src,
|
|
56833
|
+
toEntry: tgt,
|
|
56834
|
+
fromPort: sameRow ? port(srcBox, "right", src.anchorY / src.height) : port(srcBox, "bottom", 0.5),
|
|
56835
|
+
toPort: sameRow ? port(tgtBox, "left", tgt.anchorY / tgt.height) : port(tgtBox, "top", 0.5),
|
|
56836
|
+
via: sameRow && gapEnd > gapStart ? { x: (gapStart + gapEnd) / 2 } : void 0,
|
|
56837
|
+
state: tgt.node.connector?.state ?? (nodeHasFailed(src.node) ? "stopped" : nodeIsActive(tgt.node) ? "flowing" : "stopped"),
|
|
56838
|
+
sourceTone: src.node.success ? branchToneOf(src.node.success, "success") : toneOf(src.node),
|
|
56839
|
+
targetTone: toneOf(tgt.node),
|
|
56840
|
+
cfg: tgt.node.connector,
|
|
56841
|
+
label: src.node.success?.label ?? tgt.node.connector?.label,
|
|
56842
|
+
kind: "chain"
|
|
56843
|
+
});
|
|
56844
|
+
});
|
|
56845
|
+
chain.walk.forEach((w) => {
|
|
56846
|
+
if (w.card.node.failure) emitBranch(w.card, w.card.node.failure, "failure");
|
|
56847
|
+
});
|
|
56848
|
+
});
|
|
56849
|
+
const chainCardIds = /* @__PURE__ */ new Set();
|
|
56850
|
+
chains.forEach(
|
|
56851
|
+
(chain) => chain.walk.forEach((w) => chainCardIds.add(w.card.id))
|
|
56852
|
+
);
|
|
56853
|
+
laidOut.forEach((entry) => {
|
|
56854
|
+
if (chainCardIds.has(entry.id)) return;
|
|
56855
|
+
if (entry.node.success?.to) emitBranch(entry, entry.node.success, "success");
|
|
56856
|
+
if (entry.node.failure?.to) emitBranch(entry, entry.node.failure, "failure");
|
|
56857
|
+
});
|
|
56634
56858
|
const emittedBySource = /* @__PURE__ */ new Map();
|
|
56635
56859
|
edges.forEach((edge) => {
|
|
56636
56860
|
if (!edge.animated) return;
|
|
@@ -57159,6 +57383,29 @@ var ConnectionFlowSvg = ({
|
|
|
57159
57383
|
const isLit = (edge) => highlightEdges.size === 0 || highlightEdges.has(edge.id);
|
|
57160
57384
|
const nodeOpacity = (node) => highlightNodes.size === 0 || highlightNodes.has(node.id) ? 1 : 0.22;
|
|
57161
57385
|
const connectorOpacity = (connector) => highlightEdges.size === 0 || connector.edgeIds.some((id) => highlightEdges.has(id)) ? 1 : 0.22;
|
|
57386
|
+
const cardContent = (laid) => {
|
|
57387
|
+
const content = renderNode ? renderNode(laid) : /* @__PURE__ */ jsx289(
|
|
57388
|
+
ConnectionFlowNodeBody_default,
|
|
57389
|
+
{
|
|
57390
|
+
node: laid,
|
|
57391
|
+
metrics,
|
|
57392
|
+
showProgress,
|
|
57393
|
+
options,
|
|
57394
|
+
scrollable: laid.scrollable,
|
|
57395
|
+
expanded,
|
|
57396
|
+
onToggleExpanded
|
|
57397
|
+
}
|
|
57398
|
+
);
|
|
57399
|
+
return laid.scrollable ? /* @__PURE__ */ jsx289(
|
|
57400
|
+
ScrollArea_default,
|
|
57401
|
+
{
|
|
57402
|
+
variant: "auto",
|
|
57403
|
+
className: "h-full w-full",
|
|
57404
|
+
contentClassName: "block w-full",
|
|
57405
|
+
children: content
|
|
57406
|
+
}
|
|
57407
|
+
) : content;
|
|
57408
|
+
};
|
|
57162
57409
|
return /* @__PURE__ */ jsxs172("div", { className: "relative h-full w-full overflow-hidden", children: [
|
|
57163
57410
|
/* @__PURE__ */ jsxs172(
|
|
57164
57411
|
"svg",
|
|
@@ -57322,10 +57569,6 @@ var ConnectionFlowSvg = ({
|
|
|
57322
57569
|
children: /* @__PURE__ */ jsx289(
|
|
57323
57570
|
"div",
|
|
57324
57571
|
{
|
|
57325
|
-
"data-scrolls": laid.scrollable ? "" : void 0,
|
|
57326
|
-
className: classNames101(
|
|
57327
|
-
laid.scrollable && `overflow-y-auto ${THIN_SCROLLBAR_FIELD}`
|
|
57328
|
-
),
|
|
57329
57572
|
style: {
|
|
57330
57573
|
width: laid.width,
|
|
57331
57574
|
height: laid.height,
|
|
@@ -57333,19 +57576,7 @@ var ConnectionFlowSvg = ({
|
|
|
57333
57576
|
transform: `scale(${scale})`,
|
|
57334
57577
|
transformOrigin: "top left"
|
|
57335
57578
|
},
|
|
57336
|
-
|
|
57337
|
-
children: renderNode ? renderNode(laid) : /* @__PURE__ */ jsx289(
|
|
57338
|
-
ConnectionFlowNodeBody_default,
|
|
57339
|
-
{
|
|
57340
|
-
node: laid,
|
|
57341
|
-
metrics,
|
|
57342
|
-
showProgress,
|
|
57343
|
-
options,
|
|
57344
|
-
scrollable: laid.scrollable,
|
|
57345
|
-
expanded,
|
|
57346
|
-
onToggleExpanded
|
|
57347
|
-
}
|
|
57348
|
-
)
|
|
57579
|
+
children: cardContent(laid)
|
|
57349
57580
|
}
|
|
57350
57581
|
)
|
|
57351
57582
|
},
|
|
@@ -57564,6 +57795,21 @@ var ConnectionFlow = React81.forwardRef(function ConnectionFlow2({
|
|
|
57564
57795
|
observer.observe(element);
|
|
57565
57796
|
return () => observer.disconnect();
|
|
57566
57797
|
}, []);
|
|
57798
|
+
useEffect66(() => {
|
|
57799
|
+
const element = viewportRef.current;
|
|
57800
|
+
if (!element || !interactive) return;
|
|
57801
|
+
const onWheel = (event) => {
|
|
57802
|
+
if (!(event.ctrlKey || event.metaKey)) return;
|
|
57803
|
+
event.preventDefault();
|
|
57804
|
+
const rect = element.getBoundingClientRect();
|
|
57805
|
+
setZoom(
|
|
57806
|
+
scale * (event.deltaY < 0 ? 1.1 : 1 / 1.1),
|
|
57807
|
+
{ x: event.clientX - rect.left, y: event.clientY - rect.top }
|
|
57808
|
+
);
|
|
57809
|
+
};
|
|
57810
|
+
element.addEventListener("wheel", onWheel, { passive: false });
|
|
57811
|
+
return () => element.removeEventListener("wheel", onWheel);
|
|
57812
|
+
}, [interactive, scale, setZoom]);
|
|
57567
57813
|
useEffect66(() => {
|
|
57568
57814
|
if (fitOnLoad && viewport.width) fit();
|
|
57569
57815
|
}, [fitOnLoad, nodes, viewport.width, viewport.height]);
|
|
@@ -57677,22 +57923,17 @@ var ConnectionFlow = React81.forwardRef(function ConnectionFlow2({
|
|
|
57677
57923
|
style: { height: typeof height === "number" ? `${height}px` : height },
|
|
57678
57924
|
children: [
|
|
57679
57925
|
/* @__PURE__ */ jsx290(
|
|
57680
|
-
|
|
57926
|
+
ScrollArea_default,
|
|
57681
57927
|
{
|
|
57682
|
-
|
|
57683
|
-
|
|
57928
|
+
variant: "auto",
|
|
57929
|
+
viewportRef,
|
|
57930
|
+
viewportClassName: "overscroll-contain",
|
|
57931
|
+
className: "h-full w-full select-none",
|
|
57684
57932
|
style: { cursor: panning ? "grabbing" : void 0 },
|
|
57685
|
-
onWheel: (event) => {
|
|
57686
|
-
if (!interactive) return;
|
|
57687
|
-
if (event.target.closest("[data-scrolls]")) return;
|
|
57688
|
-
const rect = viewportRef.current?.getBoundingClientRect();
|
|
57689
|
-
const anchor = rect ? { x: event.clientX - rect.left, y: event.clientY - rect.top } : void 0;
|
|
57690
|
-
setZoom(scale * (event.deltaY < 0 ? 1.1 : 1 / 1.1), anchor);
|
|
57691
|
-
},
|
|
57692
57933
|
onPointerDown: (event) => {
|
|
57693
57934
|
if (!interactive || event.button !== 0) return;
|
|
57694
57935
|
if (event.target.closest(
|
|
57695
|
-
|
|
57936
|
+
'button, a, input, select, textarea, [data-no-pan], [data-slot="scrollarea-scrollbar"]'
|
|
57696
57937
|
)) {
|
|
57697
57938
|
return;
|
|
57698
57939
|
}
|
|
@@ -57705,7 +57946,7 @@ var ConnectionFlow = React81.forwardRef(function ConnectionFlow2({
|
|
|
57705
57946
|
scrollLeft: element.scrollLeft,
|
|
57706
57947
|
scrollTop: element.scrollTop
|
|
57707
57948
|
};
|
|
57708
|
-
|
|
57949
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
57709
57950
|
},
|
|
57710
57951
|
onPointerMove: (event) => {
|
|
57711
57952
|
if (!panning) return;
|
|
@@ -65727,6 +65968,7 @@ export {
|
|
|
65727
65968
|
COLLAPSIBLE_HELP_VARIANTS,
|
|
65728
65969
|
COMBOBOX_TONE_CLASSES,
|
|
65729
65970
|
COMBOBOX_VALIDATION_STATUSES,
|
|
65971
|
+
CONNECTION_FLOW_CHILD_LAYOUTS,
|
|
65730
65972
|
CONNECTION_FLOW_EDGE_STYLES,
|
|
65731
65973
|
CONNECTION_FLOW_ITEM_PROGRESS,
|
|
65732
65974
|
CONNECTION_FLOW_LOADERS,
|
|
@@ -66215,6 +66457,7 @@ export {
|
|
|
66215
66457
|
mixHex,
|
|
66216
66458
|
nicePolarMax,
|
|
66217
66459
|
niceRadarMax,
|
|
66460
|
+
nodeHasFailed,
|
|
66218
66461
|
nodeIcon,
|
|
66219
66462
|
nodeIsActive,
|
|
66220
66463
|
nodeIsSkipped,
|
|
@@ -66270,6 +66513,7 @@ export {
|
|
|
66270
66513
|
tintColor,
|
|
66271
66514
|
toBoolean,
|
|
66272
66515
|
toDate,
|
|
66516
|
+
toRows,
|
|
66273
66517
|
toSmartVariable,
|
|
66274
66518
|
tracePathTo,
|
|
66275
66519
|
usageTotals,
|