@designa8/vibedesign-stripe-deepseek-85ea 0.1.1 → 0.1.3
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/README.md +1 -1
- package/dist/index.cjs +167 -50
- package/dist/index.js +167 -50
- package/package.json +1 -1
- package/src/atoms/PaymentRoutingCanvas/PaymentRoutingCanvas.tsx +224 -47
- package/src/atoms/PaymentRoutingCanvas/preview.tsx +21 -10
- package/src/atoms/RoutingNode/RoutingNode.tsx +18 -13
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @designa8/vibedesign-stripe-deepseek-85ea
|
|
2
2
|
|
|
3
|
-
Complete design system generated by Atoms Design, version **0.1.
|
|
3
|
+
Complete design system generated by Atoms Design, version **0.1.3**.
|
|
4
4
|
Tokens, atoms, molecules, organisms, and templates — import from the package root;
|
|
5
5
|
never hardcode visual values in consumer code.
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -11854,7 +11854,7 @@ var RoutingNode = React60.forwardRef(
|
|
|
11854
11854
|
...rest
|
|
11855
11855
|
}, ref) => {
|
|
11856
11856
|
const glyph5 = icon ?? defaultIconByType[type];
|
|
11857
|
-
const
|
|
11857
|
+
const highlighted = selected || active;
|
|
11858
11858
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
11859
11859
|
"div",
|
|
11860
11860
|
{
|
|
@@ -11863,6 +11863,7 @@ var RoutingNode = React60.forwardRef(
|
|
|
11863
11863
|
style: { width: NODE_WIDTH, ...style },
|
|
11864
11864
|
"data-node-type": type,
|
|
11865
11865
|
"data-selected": selected || void 0,
|
|
11866
|
+
"data-active": active || void 0,
|
|
11866
11867
|
...rest,
|
|
11867
11868
|
children: [
|
|
11868
11869
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
@@ -11871,8 +11872,8 @@ var RoutingNode = React60.forwardRef(
|
|
|
11871
11872
|
className: cn52(
|
|
11872
11873
|
"flex items-stretch overflow-hidden rounded-md border bg-surface",
|
|
11873
11874
|
"transition duration-150 ease-out",
|
|
11874
|
-
disabled ? "border-hairline-soft opacity-50" : unreachable ? "border-dashed border-semantic-warning" : selected
|
|
11875
|
-
dragging ? "shadow-lg" :
|
|
11875
|
+
disabled ? "border-hairline-soft opacity-50" : selected && unreachable ? "border-dashed border-semantic-warning ring-2 ring-primary" : selected ? "border-primary ring-2 ring-primary" : unreachable ? "border-dashed border-semantic-warning" : active ? "border-primary ring-2 ring-primary/25" : conflict ? "border-semantic-error/50" : "border-hairline",
|
|
11876
|
+
dragging ? "shadow-lg" : highlighted ? "shadow-md" : "shadow-sm",
|
|
11876
11877
|
disabled ? "" : "group-hover/node:border-hairline-strong group-hover/node:shadow-md"
|
|
11877
11878
|
),
|
|
11878
11879
|
children: [
|
|
@@ -11928,7 +11929,7 @@ var RoutingNode = React60.forwardRef(
|
|
|
11928
11929
|
"aria-hidden": "true",
|
|
11929
11930
|
className: cn52(
|
|
11930
11931
|
"absolute -left-xs top-1/2 size-sm -translate-y-1/2 rounded-full border-2 transition-colors duration-150 ease-out",
|
|
11931
|
-
|
|
11932
|
+
highlighted ? "border-primary bg-primary" : "border-hairline-strong bg-surface"
|
|
11932
11933
|
)
|
|
11933
11934
|
}
|
|
11934
11935
|
),
|
|
@@ -11938,7 +11939,7 @@ var RoutingNode = React60.forwardRef(
|
|
|
11938
11939
|
"aria-hidden": "true",
|
|
11939
11940
|
className: cn52(
|
|
11940
11941
|
"absolute -right-xs top-1/2 size-sm -translate-y-1/2 rounded-full border-2 transition-colors duration-150 ease-out",
|
|
11941
|
-
|
|
11942
|
+
highlighted ? "border-primary bg-primary" : "border-hairline-strong bg-surface"
|
|
11942
11943
|
)
|
|
11943
11944
|
}
|
|
11944
11945
|
),
|
|
@@ -11961,7 +11962,7 @@ var RoutingNode = React60.forwardRef(
|
|
|
11961
11962
|
size: "inline",
|
|
11962
11963
|
disabled,
|
|
11963
11964
|
"aria-label": ariaLabel ?? `${eyebrowByType2[type]}, ${title}`,
|
|
11964
|
-
"aria-
|
|
11965
|
+
"aria-pressed": selected,
|
|
11965
11966
|
onClick: onNodeSelect,
|
|
11966
11967
|
className: "absolute inset-0 rounded-md focus-visible:ring-focus-blue focus-visible:ring-offset-0",
|
|
11967
11968
|
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "sr-only", children: title })
|
|
@@ -12106,6 +12107,7 @@ var SCENE_H = 342;
|
|
|
12106
12107
|
var PLANE_H = 372;
|
|
12107
12108
|
var PLANE_PAD = 18;
|
|
12108
12109
|
var PANEL_W = 296;
|
|
12110
|
+
var SNAP = 8;
|
|
12109
12111
|
var DEFAULT_NODES = [
|
|
12110
12112
|
{
|
|
12111
12113
|
id: "source",
|
|
@@ -12218,6 +12220,7 @@ var DEFAULT_SAMPLES = [
|
|
|
12218
12220
|
]
|
|
12219
12221
|
}
|
|
12220
12222
|
];
|
|
12223
|
+
var DEFAULT_SELECTION = ["brand"];
|
|
12221
12224
|
var computeIssues = (nodes, edges) => {
|
|
12222
12225
|
const issues = [];
|
|
12223
12226
|
const seenFields = /* @__PURE__ */ new Map();
|
|
@@ -12256,6 +12259,7 @@ var computeIssues = (nodes, edges) => {
|
|
|
12256
12259
|
});
|
|
12257
12260
|
return issues;
|
|
12258
12261
|
};
|
|
12262
|
+
var sameIds = (a, b) => a.length === b.length && a.every((id, index) => id === b[index]);
|
|
12259
12263
|
var PaymentRoutingCanvas = React62.forwardRef(
|
|
12260
12264
|
({
|
|
12261
12265
|
nodes,
|
|
@@ -12263,6 +12267,9 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12263
12267
|
onNodesChange,
|
|
12264
12268
|
onEdgesChange,
|
|
12265
12269
|
onNodeSelect,
|
|
12270
|
+
selectedNodeIds,
|
|
12271
|
+
defaultSelectedNodeIds,
|
|
12272
|
+
onSelectionChange,
|
|
12266
12273
|
sampleTransaction,
|
|
12267
12274
|
onSimulationStep,
|
|
12268
12275
|
onValidationChange,
|
|
@@ -12273,7 +12280,7 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12273
12280
|
const graphEdges = edges ?? DEFAULT_EDGES;
|
|
12274
12281
|
const samples = sampleTransaction ?? DEFAULT_SAMPLES;
|
|
12275
12282
|
const [localNodes, setLocalNodes] = React62.useState(incomingNodes);
|
|
12276
|
-
const [
|
|
12283
|
+
const [panelNodeId, setPanelNodeId] = React62.useState("brand");
|
|
12277
12284
|
const [panelOpen, setPanelOpen] = React62.useState(true);
|
|
12278
12285
|
const [zoom, setZoom] = React62.useState(1);
|
|
12279
12286
|
const [fit, setFit] = React62.useState(1);
|
|
@@ -12291,11 +12298,23 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12291
12298
|
const [replaying, setReplaying] = React62.useState(false);
|
|
12292
12299
|
const [focusedId, setFocusedId] = React62.useState(null);
|
|
12293
12300
|
const [anchor, setAnchor] = React62.useState({ top: 0, right: 16 });
|
|
12301
|
+
const controlledSelection = selectedNodeIds !== void 0;
|
|
12302
|
+
const [internalSelection, setInternalSelection] = React62.useState(
|
|
12303
|
+
() => defaultSelectedNodeIds ?? DEFAULT_SELECTION
|
|
12304
|
+
);
|
|
12305
|
+
const selection = controlledSelection ? selectedNodeIds : internalSelection;
|
|
12306
|
+
const selectionRef = React62.useRef(selection);
|
|
12307
|
+
selectionRef.current = selection;
|
|
12308
|
+
const onSelectionChangeRef = React62.useRef(onSelectionChange);
|
|
12309
|
+
onSelectionChangeRef.current = onSelectionChange;
|
|
12294
12310
|
const rootRef = React62.useRef(null);
|
|
12295
12311
|
const planeRef = React62.useRef(null);
|
|
12296
12312
|
const triggerRef = React62.useRef(null);
|
|
12297
12313
|
const nodeRefs = React62.useRef({});
|
|
12298
12314
|
const suppressClick = React62.useRef(false);
|
|
12315
|
+
const nodeDragActive = React62.useRef(false);
|
|
12316
|
+
const nodesRef = React62.useRef(localNodes);
|
|
12317
|
+
nodesRef.current = localNodes;
|
|
12299
12318
|
React62.useEffect(() => {
|
|
12300
12319
|
setLocalNodes(incomingNodes);
|
|
12301
12320
|
}, [incomingNodes]);
|
|
@@ -12366,69 +12385,148 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12366
12385
|
x: node.x + (side === "out" ? NODE_W : 0),
|
|
12367
12386
|
y: node.y + (node.h ?? NODE_H) / 2
|
|
12368
12387
|
});
|
|
12369
|
-
const focusedNode =
|
|
12388
|
+
const focusedNode = panelNodeId ? nodeById.get(panelNodeId) : void 0;
|
|
12389
|
+
const selectionSet = React62.useMemo(() => new Set(selection), [selection]);
|
|
12390
|
+
const commitSelection = React62.useCallback(
|
|
12391
|
+
(next) => {
|
|
12392
|
+
const unique = next.filter((id, index) => next.indexOf(id) === index);
|
|
12393
|
+
if (sameIds(unique, selectionRef.current)) return;
|
|
12394
|
+
selectionRef.current = unique;
|
|
12395
|
+
if (!controlledSelection) setInternalSelection(unique);
|
|
12396
|
+
onSelectionChangeRef.current?.(unique);
|
|
12397
|
+
},
|
|
12398
|
+
[controlledSelection]
|
|
12399
|
+
);
|
|
12400
|
+
const openNodePanel = (node) => {
|
|
12401
|
+
commitSelection([node.id]);
|
|
12402
|
+
setPanelNodeId(node.id);
|
|
12403
|
+
setPanelOpen(true);
|
|
12404
|
+
onNodeSelect?.(node);
|
|
12405
|
+
};
|
|
12370
12406
|
const selectNode = (node) => {
|
|
12371
12407
|
if (suppressClick.current) {
|
|
12372
12408
|
suppressClick.current = false;
|
|
12373
12409
|
return;
|
|
12374
12410
|
}
|
|
12375
|
-
|
|
12376
|
-
setPanelOpen(true);
|
|
12377
|
-
onNodeSelect?.(node);
|
|
12411
|
+
openNodePanel(node);
|
|
12378
12412
|
};
|
|
12379
12413
|
const closePanel = () => {
|
|
12380
|
-
const previous =
|
|
12414
|
+
const previous = panelNodeId;
|
|
12381
12415
|
setPanelOpen(false);
|
|
12382
|
-
|
|
12416
|
+
setPanelNodeId(null);
|
|
12383
12417
|
onNodeSelect?.(null);
|
|
12384
12418
|
if (previous) nodeRefs.current[previous]?.querySelector("button")?.focus();
|
|
12385
12419
|
};
|
|
12420
|
+
const clearSelection = () => {
|
|
12421
|
+
commitSelection([]);
|
|
12422
|
+
if (panelOpen) {
|
|
12423
|
+
setPanelOpen(false);
|
|
12424
|
+
setPanelNodeId(null);
|
|
12425
|
+
onNodeSelect?.(null);
|
|
12426
|
+
}
|
|
12427
|
+
};
|
|
12428
|
+
const nudgeSelection = (key) => {
|
|
12429
|
+
const ids = new Set(selectionRef.current);
|
|
12430
|
+
if (ids.size === 0) return;
|
|
12431
|
+
const dx = key === "ArrowLeft" ? -SNAP : key === "ArrowRight" ? SNAP : 0;
|
|
12432
|
+
const dy = key === "ArrowUp" ? -SNAP : key === "ArrowDown" ? SNAP : 0;
|
|
12433
|
+
if (!dx && !dy) return;
|
|
12434
|
+
const next = nodesRef.current.map(
|
|
12435
|
+
(node) => ids.has(node.id) ? { ...node, x: node.x + dx, y: node.y + dy } : node
|
|
12436
|
+
);
|
|
12437
|
+
setLocalNodes(next);
|
|
12438
|
+
onNodesChange?.(next);
|
|
12439
|
+
onEdgesChange?.(graphEdges);
|
|
12440
|
+
};
|
|
12386
12441
|
const beginDrag = (event, node) => {
|
|
12387
12442
|
if (event.button !== 0) return;
|
|
12443
|
+
event.stopPropagation();
|
|
12444
|
+
suppressClick.current = false;
|
|
12445
|
+
nodeDragActive.current = true;
|
|
12446
|
+
const additive = event.metaKey || event.ctrlKey;
|
|
12447
|
+
const current = selectionRef.current;
|
|
12448
|
+
const isIn = current.includes(node.id);
|
|
12449
|
+
let dragIds;
|
|
12450
|
+
let deselectOnClick = false;
|
|
12451
|
+
let openOnClick = false;
|
|
12452
|
+
if (additive) {
|
|
12453
|
+
if (isIn) {
|
|
12454
|
+
dragIds = current;
|
|
12455
|
+
deselectOnClick = true;
|
|
12456
|
+
} else {
|
|
12457
|
+
dragIds = [...current, node.id];
|
|
12458
|
+
commitSelection(dragIds);
|
|
12459
|
+
}
|
|
12460
|
+
} else if (isIn && current.length > 1) {
|
|
12461
|
+
dragIds = current;
|
|
12462
|
+
openOnClick = true;
|
|
12463
|
+
} else {
|
|
12464
|
+
dragIds = [node.id];
|
|
12465
|
+
if (!(current.length === 1 && current[0] === node.id)) commitSelection([node.id]);
|
|
12466
|
+
openOnClick = true;
|
|
12467
|
+
}
|
|
12468
|
+
const dragged = new Set(dragIds);
|
|
12469
|
+
const origins = /* @__PURE__ */ new Map();
|
|
12470
|
+
nodesRef.current.forEach((item) => {
|
|
12471
|
+
if (dragged.has(item.id)) origins.set(item.id, { x: item.x, y: item.y });
|
|
12472
|
+
});
|
|
12388
12473
|
const startX = event.clientX;
|
|
12389
12474
|
const startY = event.clientY;
|
|
12390
12475
|
const scale2 = fit * zoom || 1;
|
|
12391
12476
|
let moved = false;
|
|
12477
|
+
let finalNodes = null;
|
|
12392
12478
|
const move = (moveEvent) => {
|
|
12393
|
-
const
|
|
12394
|
-
const
|
|
12395
|
-
if (!moved && Math.abs(
|
|
12479
|
+
const rawX = (moveEvent.clientX - startX) / scale2;
|
|
12480
|
+
const rawY = (moveEvent.clientY - startY) / scale2;
|
|
12481
|
+
if (!moved && Math.abs(rawX) + Math.abs(rawY) < 4) return;
|
|
12396
12482
|
moved = true;
|
|
12397
|
-
|
|
12398
|
-
|
|
12399
|
-
|
|
12400
|
-
|
|
12401
|
-
|
|
12402
|
-
|
|
12403
|
-
|
|
12404
|
-
|
|
12405
|
-
);
|
|
12483
|
+
const dx = Math.round(rawX / SNAP) * SNAP;
|
|
12484
|
+
const dy = Math.round(rawY / SNAP) * SNAP;
|
|
12485
|
+
const next = nodesRef.current.map((item) => {
|
|
12486
|
+
const origin = origins.get(item.id);
|
|
12487
|
+
return origin ? { ...item, x: origin.x + dx, y: origin.y + dy } : item;
|
|
12488
|
+
});
|
|
12489
|
+
finalNodes = next;
|
|
12490
|
+
setLocalNodes(next);
|
|
12406
12491
|
};
|
|
12407
12492
|
const end = () => {
|
|
12493
|
+
nodeDragActive.current = false;
|
|
12408
12494
|
window.removeEventListener("pointermove", move);
|
|
12409
|
-
if (!moved) return;
|
|
12410
12495
|
suppressClick.current = true;
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12496
|
+
if (moved) {
|
|
12497
|
+
if (finalNodes) {
|
|
12498
|
+
onNodesChange?.(finalNodes);
|
|
12499
|
+
onEdgesChange?.(graphEdges);
|
|
12500
|
+
}
|
|
12501
|
+
return;
|
|
12502
|
+
}
|
|
12503
|
+
if (deselectOnClick) {
|
|
12504
|
+
commitSelection(selectionRef.current.filter((id) => id !== node.id));
|
|
12505
|
+
return;
|
|
12506
|
+
}
|
|
12507
|
+
if (openOnClick) openNodePanel(node);
|
|
12416
12508
|
};
|
|
12417
12509
|
window.addEventListener("pointermove", move);
|
|
12418
12510
|
window.addEventListener("pointerup", end, { once: true });
|
|
12419
12511
|
};
|
|
12420
12512
|
const beginPan = (event) => {
|
|
12421
12513
|
if (event.button !== 0) return;
|
|
12514
|
+
if (nodeDragActive.current) return;
|
|
12422
12515
|
const startX = event.clientX;
|
|
12423
12516
|
const startY = event.clientY;
|
|
12424
12517
|
const origin = pan;
|
|
12518
|
+
let moved = false;
|
|
12425
12519
|
const move = (moveEvent) => {
|
|
12426
|
-
|
|
12427
|
-
|
|
12428
|
-
|
|
12429
|
-
|
|
12520
|
+
const dx = moveEvent.clientX - startX;
|
|
12521
|
+
const dy = moveEvent.clientY - startY;
|
|
12522
|
+
if (!moved && Math.abs(dx) + Math.abs(dy) < 4) return;
|
|
12523
|
+
moved = true;
|
|
12524
|
+
setPan({ x: origin.x + dx, y: origin.y + dy });
|
|
12525
|
+
};
|
|
12526
|
+
const end = () => {
|
|
12527
|
+
window.removeEventListener("pointermove", move);
|
|
12528
|
+
if (!moved) clearSelection();
|
|
12430
12529
|
};
|
|
12431
|
-
const end = () => window.removeEventListener("pointermove", move);
|
|
12432
12530
|
window.addEventListener("pointermove", move);
|
|
12433
12531
|
window.addEventListener("pointerup", end, { once: true });
|
|
12434
12532
|
};
|
|
@@ -12456,7 +12554,7 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12456
12554
|
y: Math.min(Math.max(node.y / SCENE_H * 100 + 2, 2), 82),
|
|
12457
12555
|
w: 21,
|
|
12458
12556
|
h: 18,
|
|
12459
|
-
highlighted: node.id
|
|
12557
|
+
highlighted: selectionSet.has(node.id) || traversed.has(node.id)
|
|
12460
12558
|
}));
|
|
12461
12559
|
const issueByNode = (nodeId) => issues.filter((issue) => issue.nodeId === nodeId);
|
|
12462
12560
|
const currentStep = steps[stepIndex];
|
|
@@ -12548,12 +12646,26 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12548
12646
|
ref: planeRef,
|
|
12549
12647
|
role: "application",
|
|
12550
12648
|
"aria-label": "Payment routing graph",
|
|
12649
|
+
"aria-describedby": "routing-selection-status",
|
|
12551
12650
|
tabIndex: 0,
|
|
12552
12651
|
onPointerDown: beginPan,
|
|
12553
12652
|
onKeyDown: (event) => {
|
|
12653
|
+
const modifier = event.metaKey || event.ctrlKey;
|
|
12654
|
+
if (modifier && (event.key === "a" || event.key === "A")) {
|
|
12655
|
+
event.preventDefault();
|
|
12656
|
+
commitSelection(localNodes.map((item) => item.id));
|
|
12657
|
+
return;
|
|
12658
|
+
}
|
|
12554
12659
|
if (event.key === "Escape") {
|
|
12660
|
+
event.preventDefault();
|
|
12555
12661
|
setIssuesOpen(false);
|
|
12556
|
-
|
|
12662
|
+
clearSelection();
|
|
12663
|
+
return;
|
|
12664
|
+
}
|
|
12665
|
+
if (event.shiftKey && (event.key === "ArrowUp" || event.key === "ArrowDown" || event.key === "ArrowLeft" || event.key === "ArrowRight")) {
|
|
12666
|
+
event.preventDefault();
|
|
12667
|
+
nudgeSelection(event.key);
|
|
12668
|
+
return;
|
|
12557
12669
|
}
|
|
12558
12670
|
if (event.key === "+" || event.key === "=") {
|
|
12559
12671
|
setZoom((current) => Math.min(current + 0.1, 1.6));
|
|
@@ -12578,6 +12690,7 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12578
12690
|
backgroundSize: "16px 16px"
|
|
12579
12691
|
},
|
|
12580
12692
|
children: [
|
|
12693
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { id: "routing-selection-status", role: "status", "aria-live": "polite", className: "sr-only", children: selection.length === 0 ? "No nodes selected" : `${selection.length} node${selection.length === 1 ? "" : "s"} selected` }),
|
|
12581
12694
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
12582
12695
|
"div",
|
|
12583
12696
|
{
|
|
@@ -12622,6 +12735,7 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12622
12735
|
(issue) => issue.kind === "no-fallback"
|
|
12623
12736
|
);
|
|
12624
12737
|
const active = traversed.has(node.id);
|
|
12738
|
+
const isSelected = selectionSet.has(node.id);
|
|
12625
12739
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12626
12740
|
"div",
|
|
12627
12741
|
{
|
|
@@ -12639,31 +12753,35 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12639
12753
|
metric: node.metric,
|
|
12640
12754
|
trailing: node.trailing,
|
|
12641
12755
|
icon: node.icon,
|
|
12642
|
-
selected:
|
|
12756
|
+
selected: isSelected,
|
|
12643
12757
|
active: active && !unreachable,
|
|
12644
12758
|
unreachable,
|
|
12645
12759
|
noFallback,
|
|
12646
12760
|
conflict: conflict ? "Conflicts with Priority 2" : void 0,
|
|
12647
12761
|
disabled: node.disabled,
|
|
12648
|
-
showHint: focusedId === node.id &&
|
|
12649
|
-
ariaLabel: `${node.type}, ${node.title}${node.metric ? `, ${node.metric}` : ""}${unreachable ? ", unreachable" : ""}`,
|
|
12762
|
+
showHint: focusedId === node.id && isSelected,
|
|
12763
|
+
ariaLabel: `${node.type}, ${node.title}${node.metric ? `, ${node.metric}` : ""}${isSelected ? ", selected" : ""}${unreachable ? ", unreachable" : ""}`,
|
|
12650
12764
|
onNodeSelect: () => selectNode(node),
|
|
12651
12765
|
onFocus: () => setFocusedId(node.id),
|
|
12652
12766
|
onKeyDown: (event) => {
|
|
12767
|
+
if (event.shiftKey && (event.key === "ArrowUp" || event.key === "ArrowDown" || event.key === "ArrowLeft" || event.key === "ArrowRight")) {
|
|
12768
|
+
return;
|
|
12769
|
+
}
|
|
12653
12770
|
if (event.key === "ArrowUp" || event.key === "ArrowDown" || event.key === "ArrowLeft" || event.key === "ArrowRight") {
|
|
12654
12771
|
event.preventDefault();
|
|
12655
12772
|
moveFocus(node, event.key);
|
|
12773
|
+
return;
|
|
12656
12774
|
}
|
|
12657
|
-
if (event.key === "
|
|
12775
|
+
if (event.key === " " || event.shiftKey && event.key === "Enter") {
|
|
12658
12776
|
event.preventDefault();
|
|
12659
|
-
|
|
12660
|
-
|
|
12661
|
-
|
|
12777
|
+
commitSelection(
|
|
12778
|
+
selectionRef.current.includes(node.id) ? selectionRef.current.filter((id) => id !== node.id) : [...selectionRef.current, node.id]
|
|
12779
|
+
);
|
|
12780
|
+
return;
|
|
12662
12781
|
}
|
|
12663
|
-
if (event.key === "
|
|
12782
|
+
if (event.key === "Enter") {
|
|
12664
12783
|
event.preventDefault();
|
|
12665
|
-
|
|
12666
|
-
if (panelOpen) closePanel();
|
|
12784
|
+
openNodePanel(node);
|
|
12667
12785
|
}
|
|
12668
12786
|
}
|
|
12669
12787
|
}
|
|
@@ -12699,8 +12817,7 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12699
12817
|
onJump: (id) => {
|
|
12700
12818
|
const target = localNodes.find((node) => node.title === id);
|
|
12701
12819
|
if (!target) return;
|
|
12702
|
-
|
|
12703
|
-
setPanelOpen(true);
|
|
12820
|
+
openNodePanel(target);
|
|
12704
12821
|
setPan({ x: PLANE_PAD - target.x, y: -target.y });
|
|
12705
12822
|
}
|
|
12706
12823
|
}
|