@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.cjs
CHANGED
|
@@ -68,6 +68,7 @@ __export(src_exports, {
|
|
|
68
68
|
COLLAPSIBLE_HELP_VARIANTS: () => COLLAPSIBLE_HELP_VARIANTS,
|
|
69
69
|
COMBOBOX_TONE_CLASSES: () => COMBOBOX_TONE_CLASSES,
|
|
70
70
|
COMBOBOX_VALIDATION_STATUSES: () => COMBOBOX_VALIDATION_STATUSES,
|
|
71
|
+
CONNECTION_FLOW_CHILD_LAYOUTS: () => CONNECTION_FLOW_CHILD_LAYOUTS,
|
|
71
72
|
CONNECTION_FLOW_EDGE_STYLES: () => CONNECTION_FLOW_EDGE_STYLES,
|
|
72
73
|
CONNECTION_FLOW_ITEM_PROGRESS: () => CONNECTION_FLOW_ITEM_PROGRESS,
|
|
73
74
|
CONNECTION_FLOW_LOADERS: () => CONNECTION_FLOW_LOADERS,
|
|
@@ -556,6 +557,7 @@ __export(src_exports, {
|
|
|
556
557
|
mixHex: () => mixHex,
|
|
557
558
|
nicePolarMax: () => nicePolarMax,
|
|
558
559
|
niceRadarMax: () => niceRadarMax,
|
|
560
|
+
nodeHasFailed: () => nodeHasFailed,
|
|
559
561
|
nodeIcon: () => nodeIcon,
|
|
560
562
|
nodeIsActive: () => nodeIsActive,
|
|
561
563
|
nodeIsSkipped: () => nodeIsSkipped,
|
|
@@ -611,6 +613,7 @@ __export(src_exports, {
|
|
|
611
613
|
tintColor: () => tintColor,
|
|
612
614
|
toBoolean: () => toBoolean,
|
|
613
615
|
toDate: () => toDate,
|
|
616
|
+
toRows: () => toRows,
|
|
614
617
|
toSmartVariable: () => toSmartVariable,
|
|
615
618
|
tracePathTo: () => tracePathTo,
|
|
616
619
|
usageTotals: () => usageTotals,
|
|
@@ -16345,12 +16348,23 @@ var ScrollArea = ({
|
|
|
16345
16348
|
mask = false,
|
|
16346
16349
|
tabIndex = 0,
|
|
16347
16350
|
contentClassName,
|
|
16351
|
+
viewportClassName,
|
|
16352
|
+
viewportRef: viewportRefProp,
|
|
16348
16353
|
children,
|
|
16349
16354
|
className = "",
|
|
16350
16355
|
...rest
|
|
16351
16356
|
}) => {
|
|
16352
16357
|
const viewportId = (0, import_react176.useId)();
|
|
16353
16358
|
const viewportRef = (0, import_react176.useRef)(null);
|
|
16359
|
+
const setViewportRef = (0, import_react176.useCallback)(
|
|
16360
|
+
(el) => {
|
|
16361
|
+
viewportRef.current = el;
|
|
16362
|
+
if (typeof viewportRefProp === "function") viewportRefProp(el);
|
|
16363
|
+
else if (viewportRefProp)
|
|
16364
|
+
viewportRefProp.current = el;
|
|
16365
|
+
},
|
|
16366
|
+
[viewportRefProp]
|
|
16367
|
+
);
|
|
16354
16368
|
const contentRef = (0, import_react176.useRef)(null);
|
|
16355
16369
|
const yTrackRef = (0, import_react176.useRef)(null);
|
|
16356
16370
|
const xTrackRef = (0, import_react176.useRef)(null);
|
|
@@ -16492,7 +16506,7 @@ var ScrollArea = ({
|
|
|
16492
16506
|
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
|
|
16493
16507
|
"div",
|
|
16494
16508
|
{
|
|
16495
|
-
ref:
|
|
16509
|
+
ref: setViewportRef,
|
|
16496
16510
|
id: viewportId,
|
|
16497
16511
|
"data-slot": "scrollarea-viewport",
|
|
16498
16512
|
tabIndex: overflow.x || overflow.y ? tabIndex : -1,
|
|
@@ -16507,7 +16521,8 @@ var ScrollArea = ({
|
|
|
16507
16521
|
// and the viewport would simply grow past the frame's cap, get
|
|
16508
16522
|
// clipped by `overflow-hidden` and never learn it was scrollable.
|
|
16509
16523
|
"[scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
16510
|
-
"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400"
|
|
16524
|
+
"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400",
|
|
16525
|
+
viewportClassName
|
|
16511
16526
|
),
|
|
16512
16527
|
children: /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
|
|
16513
16528
|
"div",
|
|
@@ -56086,6 +56101,7 @@ var CONNECTION_FLOW_EDGE_STYLES = [
|
|
|
56086
56101
|
"curved",
|
|
56087
56102
|
"straight"
|
|
56088
56103
|
];
|
|
56104
|
+
var CONNECTION_FLOW_CHILD_LAYOUTS = ["fan", "chain"];
|
|
56089
56105
|
var CONNECTION_FLOW_LOADERS = [
|
|
56090
56106
|
"skeleton",
|
|
56091
56107
|
"spinner",
|
|
@@ -56224,6 +56240,8 @@ var DEFAULT_LAYOUT_OPTIONS = {
|
|
|
56224
56240
|
laneGap: 16,
|
|
56225
56241
|
childGap: 12,
|
|
56226
56242
|
childIndent: 28,
|
|
56243
|
+
rowGap: 12,
|
|
56244
|
+
gridIndent: 28,
|
|
56227
56245
|
edgeStyle: "orthogonal",
|
|
56228
56246
|
cornerRadius: 8,
|
|
56229
56247
|
bypassLift: 18,
|
|
@@ -56249,6 +56267,8 @@ var NODE_CORNER_RADIUS = Object.fromEntries(
|
|
|
56249
56267
|
var nodeTone = (node) => node?.tone ?? (node?.status ? STATUS_TONE[node.status] : "neutral");
|
|
56250
56268
|
var nodeIcon = (node) => node?.icon ?? (node?.status ? STATUS_ICON2[node.status] : void 0);
|
|
56251
56269
|
var nodeIsActive = (node) => node?.active ?? node?.status === "running";
|
|
56270
|
+
var nodeHasFailed = (node) => node?.status === "failed";
|
|
56271
|
+
var toRows = (node) => node.rows ?? (node.children ?? []).map((child) => [child]);
|
|
56252
56272
|
var nodeIsSkipped = (node) => node?.skipped ?? (node?.status === "skipped" ? true : void 0);
|
|
56253
56273
|
|
|
56254
56274
|
// ../common/connectionFlow/measure.ts
|
|
@@ -56329,6 +56349,15 @@ var nodeScrolls = (node, options, expanded) => {
|
|
|
56329
56349
|
};
|
|
56330
56350
|
var measureBranch = (node, options, expanded) => {
|
|
56331
56351
|
const own = measureNode(node, options, expanded);
|
|
56352
|
+
if (node.childLayout === "chain") {
|
|
56353
|
+
const rows = toRows(node);
|
|
56354
|
+
if (rows.length === 0) return own;
|
|
56355
|
+
const rowsHeight = rows.reduce(
|
|
56356
|
+
(sum, row, index) => sum + Math.max(0, ...row.map((c) => measureBranch(c, options, expanded))) + (index > 0 ? options.rowGap : 0),
|
|
56357
|
+
0
|
|
56358
|
+
);
|
|
56359
|
+
return own + options.childGap + rowsHeight;
|
|
56360
|
+
}
|
|
56332
56361
|
const children = node.children ?? [];
|
|
56333
56362
|
if (children.length === 0) return own;
|
|
56334
56363
|
const childHeight = children.reduce(
|
|
@@ -56724,6 +56753,7 @@ var layoutConnectionFlow = (input) => {
|
|
|
56724
56753
|
const skipped = resolveSkipped(columns, input.autoState ?? false);
|
|
56725
56754
|
const laidOut = [];
|
|
56726
56755
|
const byId = /* @__PURE__ */ new Map();
|
|
56756
|
+
const chains = /* @__PURE__ */ new Map();
|
|
56727
56757
|
let x = options.padding;
|
|
56728
56758
|
const columnBounds = [];
|
|
56729
56759
|
columns.forEach((column, columnIndex) => {
|
|
@@ -56774,15 +56804,68 @@ var layoutConnectionFlow = (input) => {
|
|
|
56774
56804
|
placeChildren(child, depth + 1, indentX + options.childIndent);
|
|
56775
56805
|
});
|
|
56776
56806
|
};
|
|
56777
|
-
|
|
56807
|
+
if (node.childLayout === "chain") {
|
|
56808
|
+
const rows = toRows(node);
|
|
56809
|
+
if (rows.length > 0) {
|
|
56810
|
+
const cardWidth = options.metrics.width;
|
|
56811
|
+
const gridX = x + options.gridIndent;
|
|
56812
|
+
let rowY = y + ownHeight + options.childGap;
|
|
56813
|
+
const walk2 = [];
|
|
56814
|
+
let maxCols = 1;
|
|
56815
|
+
rows.forEach((row, rowIdx) => {
|
|
56816
|
+
maxCols = Math.max(maxCols, row.length);
|
|
56817
|
+
let rowBottom = rowY;
|
|
56818
|
+
row.forEach((card, col) => {
|
|
56819
|
+
const cardHeight = measureNode(card, options, input.expanded);
|
|
56820
|
+
const cardEntry = {
|
|
56821
|
+
id: card.id,
|
|
56822
|
+
node: card,
|
|
56823
|
+
outline: "",
|
|
56824
|
+
x: gridX + col * (cardWidth + options.connectorWidth),
|
|
56825
|
+
y: rowY,
|
|
56826
|
+
width: cardWidth,
|
|
56827
|
+
height: cardHeight,
|
|
56828
|
+
anchorY: cardHeight / 2,
|
|
56829
|
+
column: columnIndex,
|
|
56830
|
+
depth: 1,
|
|
56831
|
+
tone: toneOf(card),
|
|
56832
|
+
scrollable: nodeScrolls(card, options, input.expanded)
|
|
56833
|
+
};
|
|
56834
|
+
laidOut.push(cardEntry);
|
|
56835
|
+
byId.set(card.id, cardEntry);
|
|
56836
|
+
walk2.push({ card: cardEntry, row: rowIdx });
|
|
56837
|
+
rowBottom = Math.max(rowBottom, rowY + cardHeight);
|
|
56838
|
+
});
|
|
56839
|
+
rowY = rowBottom + options.rowGap;
|
|
56840
|
+
});
|
|
56841
|
+
const live = walk2.filter((w) => !nodeIsSkipped(w.card.node));
|
|
56842
|
+
const exitCard = live.length > 0 ? live[live.length - 1].card : null;
|
|
56843
|
+
chains.set(node.id, {
|
|
56844
|
+
parentNode: node,
|
|
56845
|
+
walk: walk2,
|
|
56846
|
+
exitCard,
|
|
56847
|
+
exitHasBranch: Boolean(exitCard?.node.success?.to),
|
|
56848
|
+
gridWidth: options.gridIndent + maxCols * cardWidth + (maxCols - 1) * options.connectorWidth
|
|
56849
|
+
});
|
|
56850
|
+
} else {
|
|
56851
|
+
placeChildren(node, 1, x + options.childIndent);
|
|
56852
|
+
}
|
|
56853
|
+
} else {
|
|
56854
|
+
placeChildren(node, 1, x + options.childIndent);
|
|
56855
|
+
}
|
|
56778
56856
|
y += heights[laneIndex] + options.laneGap;
|
|
56779
56857
|
});
|
|
56858
|
+
const chainInfo = column.parallel ? void 0 : chains.get(column.nodes[0].id);
|
|
56859
|
+
const columnWidth = Math.max(
|
|
56860
|
+
options.metrics.width,
|
|
56861
|
+
chainInfo?.gridWidth ?? 0
|
|
56862
|
+
);
|
|
56780
56863
|
columnBounds.push({
|
|
56781
56864
|
start: x,
|
|
56782
|
-
end: x +
|
|
56865
|
+
end: x + columnWidth,
|
|
56783
56866
|
centre: options.padding + stackHeight / 2
|
|
56784
56867
|
});
|
|
56785
|
-
x +=
|
|
56868
|
+
x += columnWidth + options.connectorWidth;
|
|
56786
56869
|
});
|
|
56787
56870
|
const edges = [];
|
|
56788
56871
|
const connectors = /* @__PURE__ */ new Map();
|
|
@@ -56840,7 +56923,10 @@ var layoutConnectionFlow = (input) => {
|
|
|
56840
56923
|
if (columnIsTerminal(sourceIndex)) return;
|
|
56841
56924
|
if (skipped.has(columnIndex)) return;
|
|
56842
56925
|
const isBypass = sourceIndex !== columnIndex - 1;
|
|
56843
|
-
const
|
|
56926
|
+
const chainSrc = columns[sourceIndex].parallel ? void 0 : chains.get(columns[sourceIndex].nodes[0].id);
|
|
56927
|
+
if (chainSrc && (!chainSrc.exitCard || chainSrc.exitHasBranch)) return;
|
|
56928
|
+
if (chainSrc?.exitCard?.node.terminal === true) return;
|
|
56929
|
+
const sourceNodes = chainSrc?.exitCard ? [chainSrc.exitCard.node] : columns[sourceIndex].nodes;
|
|
56844
56930
|
const targetNodes = column.nodes;
|
|
56845
56931
|
const state = (sourceNode, targetNode) => targetNode.connector?.state ?? (input.autoState ? toneOf(sourceNode) !== "neutral" ? nodeIsActive(targetNode) ? "flowing" : "stopped" : "disabled" : input.flowState ?? "flowing");
|
|
56846
56932
|
const animatedFor = (cfg, edgeState) => (cfg?.animated ?? input.animated ?? true) && (edgeState === "flowing" || edgeState === "stopped" && (cfg?.animateCompleted ?? false));
|
|
@@ -56850,7 +56936,7 @@ var layoutConnectionFlow = (input) => {
|
|
|
56850
56936
|
labelUsed = true;
|
|
56851
56937
|
return label;
|
|
56852
56938
|
};
|
|
56853
|
-
const sourceSpan = columnBox(sourceIndex);
|
|
56939
|
+
const sourceSpan = chainSrc?.exitCard ? boxOf(chainSrc.exitCard) : columnBox(sourceIndex);
|
|
56854
56940
|
const targetSpan = columnBox(columnIndex);
|
|
56855
56941
|
if (!sourceSpan || !targetSpan) return;
|
|
56856
56942
|
const sides = selectSides(sourceSpan, targetSpan);
|
|
@@ -56934,6 +57020,7 @@ var layoutConnectionFlow = (input) => {
|
|
|
56934
57020
|
});
|
|
56935
57021
|
});
|
|
56936
57022
|
const childEdges = (parent) => {
|
|
57023
|
+
if (parent.childLayout === "chain") return;
|
|
56937
57024
|
const parentEntry = byId.get(parent.id);
|
|
56938
57025
|
if (!parentEntry) return;
|
|
56939
57026
|
(parent.children ?? []).forEach((child) => {
|
|
@@ -56995,6 +57082,146 @@ var layoutConnectionFlow = (input) => {
|
|
|
56995
57082
|
});
|
|
56996
57083
|
};
|
|
56997
57084
|
input.nodes.forEach(childEdges);
|
|
57085
|
+
const emitFlowEdge = (o) => {
|
|
57086
|
+
const route = routePorts(o.fromPort, o.toPort, {
|
|
57087
|
+
style: o.cfg?.edgeStyle ?? options.edgeStyle,
|
|
57088
|
+
stub: Math.min(18, options.connectorWidth / 3),
|
|
57089
|
+
radius: options.cornerRadius,
|
|
57090
|
+
trim: trimFor(o.cfg),
|
|
57091
|
+
via: o.via
|
|
57092
|
+
});
|
|
57093
|
+
const animated = (o.cfg?.animated ?? input.animated ?? true) && (o.state === "flowing" || o.state === "stopped" && (o.cfg?.animateCompleted ?? false));
|
|
57094
|
+
addConnector(o.fromEntry.id, o.fromPort, o.sourceTone, o.state, animated, o.id, o.cfg);
|
|
57095
|
+
addConnector(o.toEntry.id, o.toPort, o.targetTone, o.state, animated, o.id, o.cfg);
|
|
57096
|
+
edges.push({
|
|
57097
|
+
id: o.id,
|
|
57098
|
+
fromId: o.fromEntry.id,
|
|
57099
|
+
toId: o.toEntry.id,
|
|
57100
|
+
state: o.state,
|
|
57101
|
+
points: route.points,
|
|
57102
|
+
d: route.d,
|
|
57103
|
+
sourceTone: o.sourceTone,
|
|
57104
|
+
targetTone: o.targetTone,
|
|
57105
|
+
bypass: false,
|
|
57106
|
+
emitIndex: 0,
|
|
57107
|
+
emitCount: 1,
|
|
57108
|
+
emitSpan: 0,
|
|
57109
|
+
animated,
|
|
57110
|
+
label: o.label,
|
|
57111
|
+
kind: o.kind,
|
|
57112
|
+
branchKind: o.branchKind
|
|
57113
|
+
});
|
|
57114
|
+
};
|
|
57115
|
+
const sidePort = (entry, side) => port(boxOf(entry), side, entry.anchorY / entry.height);
|
|
57116
|
+
const branchToneOf = (branch, kind) => branch.tone ?? (kind === "success" ? STATUS_TONE.succeeded : STATUS_TONE.failed);
|
|
57117
|
+
const emitBranch = (fromEntry, branch, kind) => {
|
|
57118
|
+
if (!branch.to) return;
|
|
57119
|
+
const target = byId.get(branch.to);
|
|
57120
|
+
if (!target || target.id === fromEntry.id) return;
|
|
57121
|
+
const tone = branchToneOf(branch, kind);
|
|
57122
|
+
const state = kind === "failure" ? nodeHasFailed(fromEntry.node) ? "flowing" : "stopped" : nodeHasFailed(fromEntry.node) ? "stopped" : "flowing";
|
|
57123
|
+
const srcBox = boxOf(fromEntry);
|
|
57124
|
+
const tgtBox = boxOf(target);
|
|
57125
|
+
const upstream = tgtBox.y + tgtBox.height <= srcBox.y + 1 || tgtBox.x + tgtBox.width <= srcBox.x + 1;
|
|
57126
|
+
if (upstream && kind === "failure") {
|
|
57127
|
+
emitFlowEdge({
|
|
57128
|
+
id: `${fromEntry.id}~fail>${target.id}`,
|
|
57129
|
+
fromEntry,
|
|
57130
|
+
toEntry: target,
|
|
57131
|
+
fromPort: port(srcBox, "left", fromEntry.anchorY / fromEntry.height),
|
|
57132
|
+
toPort: port(tgtBox, "top", 0.5),
|
|
57133
|
+
via: { x: Math.min(srcBox.x, tgtBox.x) - options.bypassLift },
|
|
57134
|
+
state,
|
|
57135
|
+
sourceTone: tone,
|
|
57136
|
+
targetTone: tone,
|
|
57137
|
+
label: branch.label,
|
|
57138
|
+
kind: "branch",
|
|
57139
|
+
branchKind: kind
|
|
57140
|
+
});
|
|
57141
|
+
return;
|
|
57142
|
+
}
|
|
57143
|
+
const sides = selectSides(srcBox, tgtBox);
|
|
57144
|
+
emitFlowEdge({
|
|
57145
|
+
id: `${fromEntry.id}~${kind === "failure" ? "fail" : "ok"}>${target.id}`,
|
|
57146
|
+
fromEntry,
|
|
57147
|
+
toEntry: target,
|
|
57148
|
+
fromPort: sidePort(fromEntry, sides.from),
|
|
57149
|
+
toPort: sidePort(target, sides.to),
|
|
57150
|
+
state,
|
|
57151
|
+
sourceTone: tone,
|
|
57152
|
+
targetTone: tone,
|
|
57153
|
+
label: branch.label,
|
|
57154
|
+
kind: "branch",
|
|
57155
|
+
branchKind: kind
|
|
57156
|
+
});
|
|
57157
|
+
};
|
|
57158
|
+
chains.forEach((chain) => {
|
|
57159
|
+
const parentEntry = byId.get(chain.parentNode.id);
|
|
57160
|
+
if (!parentEntry) return;
|
|
57161
|
+
if (nodeIsSkipped(chain.parentNode) === true) return;
|
|
57162
|
+
const live = chain.walk.filter((w) => !nodeIsSkipped(w.card.node));
|
|
57163
|
+
if (live.length === 0) return;
|
|
57164
|
+
const first = live[0].card;
|
|
57165
|
+
const parentBox = boxOf(parentEntry);
|
|
57166
|
+
const firstBox = boxOf(first);
|
|
57167
|
+
emitFlowEdge({
|
|
57168
|
+
id: `${parentEntry.id}~in>${first.id}`,
|
|
57169
|
+
fromEntry: parentEntry,
|
|
57170
|
+
toEntry: first,
|
|
57171
|
+
fromPort: portAt(
|
|
57172
|
+
parentBox,
|
|
57173
|
+
"bottom",
|
|
57174
|
+
firstBox.x + firstBox.width / 2 - parentBox.x
|
|
57175
|
+
),
|
|
57176
|
+
toPort: port(firstBox, "top", 0.5),
|
|
57177
|
+
state: first.node.connector?.state ?? (nodeHasFailed(parentEntry.node) ? "stopped" : nodeIsActive(first.node) ? "flowing" : "stopped"),
|
|
57178
|
+
sourceTone: toneOf(parentEntry.node),
|
|
57179
|
+
targetTone: toneOf(first.node),
|
|
57180
|
+
cfg: first.node.connector,
|
|
57181
|
+
kind: "chain"
|
|
57182
|
+
});
|
|
57183
|
+
live.forEach((w, i) => {
|
|
57184
|
+
const src = w.card;
|
|
57185
|
+
if (src.node.success?.to) {
|
|
57186
|
+
emitBranch(src, src.node.success, "success");
|
|
57187
|
+
return;
|
|
57188
|
+
}
|
|
57189
|
+
const next = live[i + 1];
|
|
57190
|
+
if (!next) return;
|
|
57191
|
+
const tgt = next.card;
|
|
57192
|
+
const srcBox = boxOf(src);
|
|
57193
|
+
const tgtBox = boxOf(tgt);
|
|
57194
|
+
const sameRow = next.row === w.row;
|
|
57195
|
+
const gapStart = srcBox.x + srcBox.width;
|
|
57196
|
+
const gapEnd = tgtBox.x;
|
|
57197
|
+
emitFlowEdge({
|
|
57198
|
+
id: `${src.id}~walk>${tgt.id}`,
|
|
57199
|
+
fromEntry: src,
|
|
57200
|
+
toEntry: tgt,
|
|
57201
|
+
fromPort: sameRow ? port(srcBox, "right", src.anchorY / src.height) : port(srcBox, "bottom", 0.5),
|
|
57202
|
+
toPort: sameRow ? port(tgtBox, "left", tgt.anchorY / tgt.height) : port(tgtBox, "top", 0.5),
|
|
57203
|
+
via: sameRow && gapEnd > gapStart ? { x: (gapStart + gapEnd) / 2 } : void 0,
|
|
57204
|
+
state: tgt.node.connector?.state ?? (nodeHasFailed(src.node) ? "stopped" : nodeIsActive(tgt.node) ? "flowing" : "stopped"),
|
|
57205
|
+
sourceTone: src.node.success ? branchToneOf(src.node.success, "success") : toneOf(src.node),
|
|
57206
|
+
targetTone: toneOf(tgt.node),
|
|
57207
|
+
cfg: tgt.node.connector,
|
|
57208
|
+
label: src.node.success?.label ?? tgt.node.connector?.label,
|
|
57209
|
+
kind: "chain"
|
|
57210
|
+
});
|
|
57211
|
+
});
|
|
57212
|
+
chain.walk.forEach((w) => {
|
|
57213
|
+
if (w.card.node.failure) emitBranch(w.card, w.card.node.failure, "failure");
|
|
57214
|
+
});
|
|
57215
|
+
});
|
|
57216
|
+
const chainCardIds = /* @__PURE__ */ new Set();
|
|
57217
|
+
chains.forEach(
|
|
57218
|
+
(chain) => chain.walk.forEach((w) => chainCardIds.add(w.card.id))
|
|
57219
|
+
);
|
|
57220
|
+
laidOut.forEach((entry) => {
|
|
57221
|
+
if (chainCardIds.has(entry.id)) return;
|
|
57222
|
+
if (entry.node.success?.to) emitBranch(entry, entry.node.success, "success");
|
|
57223
|
+
if (entry.node.failure?.to) emitBranch(entry, entry.node.failure, "failure");
|
|
57224
|
+
});
|
|
56998
57225
|
const emittedBySource = /* @__PURE__ */ new Map();
|
|
56999
57226
|
edges.forEach((edge) => {
|
|
57000
57227
|
if (!edge.animated) return;
|
|
@@ -57525,6 +57752,29 @@ var ConnectionFlowSvg = ({
|
|
|
57525
57752
|
const isLit = (edge) => highlightEdges.size === 0 || highlightEdges.has(edge.id);
|
|
57526
57753
|
const nodeOpacity = (node) => highlightNodes.size === 0 || highlightNodes.has(node.id) ? 1 : 0.22;
|
|
57527
57754
|
const connectorOpacity = (connector) => highlightEdges.size === 0 || connector.edgeIds.some((id) => highlightEdges.has(id)) ? 1 : 0.22;
|
|
57755
|
+
const cardContent = (laid) => {
|
|
57756
|
+
const content = renderNode ? renderNode(laid) : /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(
|
|
57757
|
+
ConnectionFlowNodeBody_default,
|
|
57758
|
+
{
|
|
57759
|
+
node: laid,
|
|
57760
|
+
metrics,
|
|
57761
|
+
showProgress,
|
|
57762
|
+
options,
|
|
57763
|
+
scrollable: laid.scrollable,
|
|
57764
|
+
expanded,
|
|
57765
|
+
onToggleExpanded
|
|
57766
|
+
}
|
|
57767
|
+
);
|
|
57768
|
+
return laid.scrollable ? /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(
|
|
57769
|
+
ScrollArea_default,
|
|
57770
|
+
{
|
|
57771
|
+
variant: "auto",
|
|
57772
|
+
className: "h-full w-full",
|
|
57773
|
+
contentClassName: "block w-full",
|
|
57774
|
+
children: content
|
|
57775
|
+
}
|
|
57776
|
+
) : content;
|
|
57777
|
+
};
|
|
57528
57778
|
return /* @__PURE__ */ (0, import_jsx_runtime289.jsxs)("div", { className: "relative h-full w-full overflow-hidden", children: [
|
|
57529
57779
|
/* @__PURE__ */ (0, import_jsx_runtime289.jsxs)(
|
|
57530
57780
|
"svg",
|
|
@@ -57688,10 +57938,6 @@ var ConnectionFlowSvg = ({
|
|
|
57688
57938
|
children: /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(
|
|
57689
57939
|
"div",
|
|
57690
57940
|
{
|
|
57691
|
-
"data-scrolls": laid.scrollable ? "" : void 0,
|
|
57692
|
-
className: (0, import_classnames101.default)(
|
|
57693
|
-
laid.scrollable && `overflow-y-auto ${THIN_SCROLLBAR_FIELD}`
|
|
57694
|
-
),
|
|
57695
57941
|
style: {
|
|
57696
57942
|
width: laid.width,
|
|
57697
57943
|
height: laid.height,
|
|
@@ -57699,19 +57945,7 @@ var ConnectionFlowSvg = ({
|
|
|
57699
57945
|
transform: `scale(${scale})`,
|
|
57700
57946
|
transformOrigin: "top left"
|
|
57701
57947
|
},
|
|
57702
|
-
|
|
57703
|
-
children: renderNode ? renderNode(laid) : /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(
|
|
57704
|
-
ConnectionFlowNodeBody_default,
|
|
57705
|
-
{
|
|
57706
|
-
node: laid,
|
|
57707
|
-
metrics,
|
|
57708
|
-
showProgress,
|
|
57709
|
-
options,
|
|
57710
|
-
scrollable: laid.scrollable,
|
|
57711
|
-
expanded,
|
|
57712
|
-
onToggleExpanded
|
|
57713
|
-
}
|
|
57714
|
-
)
|
|
57948
|
+
children: cardContent(laid)
|
|
57715
57949
|
}
|
|
57716
57950
|
)
|
|
57717
57951
|
},
|
|
@@ -57930,6 +58164,21 @@ var ConnectionFlow = import_react271.default.forwardRef(function ConnectionFlow2
|
|
|
57930
58164
|
observer.observe(element);
|
|
57931
58165
|
return () => observer.disconnect();
|
|
57932
58166
|
}, []);
|
|
58167
|
+
(0, import_react271.useEffect)(() => {
|
|
58168
|
+
const element = viewportRef.current;
|
|
58169
|
+
if (!element || !interactive) return;
|
|
58170
|
+
const onWheel = (event) => {
|
|
58171
|
+
if (!(event.ctrlKey || event.metaKey)) return;
|
|
58172
|
+
event.preventDefault();
|
|
58173
|
+
const rect = element.getBoundingClientRect();
|
|
58174
|
+
setZoom(
|
|
58175
|
+
scale * (event.deltaY < 0 ? 1.1 : 1 / 1.1),
|
|
58176
|
+
{ x: event.clientX - rect.left, y: event.clientY - rect.top }
|
|
58177
|
+
);
|
|
58178
|
+
};
|
|
58179
|
+
element.addEventListener("wheel", onWheel, { passive: false });
|
|
58180
|
+
return () => element.removeEventListener("wheel", onWheel);
|
|
58181
|
+
}, [interactive, scale, setZoom]);
|
|
57933
58182
|
(0, import_react271.useEffect)(() => {
|
|
57934
58183
|
if (fitOnLoad && viewport.width) fit();
|
|
57935
58184
|
}, [fitOnLoad, nodes, viewport.width, viewport.height]);
|
|
@@ -58043,22 +58292,17 @@ var ConnectionFlow = import_react271.default.forwardRef(function ConnectionFlow2
|
|
|
58043
58292
|
style: { height: typeof height === "number" ? `${height}px` : height },
|
|
58044
58293
|
children: [
|
|
58045
58294
|
/* @__PURE__ */ (0, import_jsx_runtime290.jsx)(
|
|
58046
|
-
|
|
58295
|
+
ScrollArea_default,
|
|
58047
58296
|
{
|
|
58048
|
-
|
|
58049
|
-
|
|
58297
|
+
variant: "auto",
|
|
58298
|
+
viewportRef,
|
|
58299
|
+
viewportClassName: "overscroll-contain",
|
|
58300
|
+
className: "h-full w-full select-none",
|
|
58050
58301
|
style: { cursor: panning ? "grabbing" : void 0 },
|
|
58051
|
-
onWheel: (event) => {
|
|
58052
|
-
if (!interactive) return;
|
|
58053
|
-
if (event.target.closest("[data-scrolls]")) return;
|
|
58054
|
-
const rect = viewportRef.current?.getBoundingClientRect();
|
|
58055
|
-
const anchor = rect ? { x: event.clientX - rect.left, y: event.clientY - rect.top } : void 0;
|
|
58056
|
-
setZoom(scale * (event.deltaY < 0 ? 1.1 : 1 / 1.1), anchor);
|
|
58057
|
-
},
|
|
58058
58302
|
onPointerDown: (event) => {
|
|
58059
58303
|
if (!interactive || event.button !== 0) return;
|
|
58060
58304
|
if (event.target.closest(
|
|
58061
|
-
|
|
58305
|
+
'button, a, input, select, textarea, [data-no-pan], [data-slot="scrollarea-scrollbar"]'
|
|
58062
58306
|
)) {
|
|
58063
58307
|
return;
|
|
58064
58308
|
}
|
|
@@ -58071,7 +58315,7 @@ var ConnectionFlow = import_react271.default.forwardRef(function ConnectionFlow2
|
|
|
58071
58315
|
scrollLeft: element.scrollLeft,
|
|
58072
58316
|
scrollTop: element.scrollTop
|
|
58073
58317
|
};
|
|
58074
|
-
|
|
58318
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
58075
58319
|
},
|
|
58076
58320
|
onPointerMove: (event) => {
|
|
58077
58321
|
if (!panning) return;
|
|
@@ -66071,6 +66315,7 @@ MetricBar.displayName = "MetricBar";
|
|
|
66071
66315
|
COLLAPSIBLE_HELP_VARIANTS,
|
|
66072
66316
|
COMBOBOX_TONE_CLASSES,
|
|
66073
66317
|
COMBOBOX_VALIDATION_STATUSES,
|
|
66318
|
+
CONNECTION_FLOW_CHILD_LAYOUTS,
|
|
66074
66319
|
CONNECTION_FLOW_EDGE_STYLES,
|
|
66075
66320
|
CONNECTION_FLOW_ITEM_PROGRESS,
|
|
66076
66321
|
CONNECTION_FLOW_LOADERS,
|
|
@@ -66559,6 +66804,7 @@ MetricBar.displayName = "MetricBar";
|
|
|
66559
66804
|
mixHex,
|
|
66560
66805
|
nicePolarMax,
|
|
66561
66806
|
niceRadarMax,
|
|
66807
|
+
nodeHasFailed,
|
|
66562
66808
|
nodeIcon,
|
|
66563
66809
|
nodeIsActive,
|
|
66564
66810
|
nodeIsSkipped,
|
|
@@ -66614,6 +66860,7 @@ MetricBar.displayName = "MetricBar";
|
|
|
66614
66860
|
tintColor,
|
|
66615
66861
|
toBoolean,
|
|
66616
66862
|
toDate,
|
|
66863
|
+
toRows,
|
|
66617
66864
|
toSmartVariable,
|
|
66618
66865
|
tracePathTo,
|
|
66619
66866
|
usageTotals,
|