@industry-theme/principal-view-panels 0.12.46 → 0.12.47
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TraceListPanel.d.ts","sourceRoot":"","sources":["../../src/panels/TraceListPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,KAAK,EAAE,wBAAwB,EAAwB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"TraceListPanel.d.ts","sourceRoot":"","sources":["../../src/panels/TraceListPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,KAAK,EAAE,wBAAwB,EAAwB,MAAM,UAAU,CAAC;AAmB/E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAujD7D,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -86710,12 +86710,16 @@ const CustomNode = ({ data, selected: selected2, dragging }) => {
|
|
|
86710
86710
|
const eventData = nodeData == null ? void 0 : nodeData.event;
|
|
86711
86711
|
const eventName = eventData == null ? void 0 : eventData.name;
|
|
86712
86712
|
const showEventName = eventName && eventName !== displayName;
|
|
86713
|
+
const renderWithDotBreaks = (text2) => {
|
|
86714
|
+
const parts = text2.split(".");
|
|
86715
|
+
return parts.map((part, i) => jsxs("span", { children: [part, i < parts.length - 1 && jsxs(Fragment, { children: [".", jsx("wbr", {})] })] }, i));
|
|
86716
|
+
};
|
|
86713
86717
|
const renderNameWithEvent = (centered = true) => jsxs("div", { style: { textAlign: centered ? "center" : "left", wordBreak: "break-word" }, children: [jsx("div", { children: displayName }), showEventName && jsx("div", { style: {
|
|
86714
86718
|
fontSize: theme2.fontSizes[0] * 0.75,
|
|
86715
86719
|
color: "rgba(0, 0, 0, 0.5)",
|
|
86716
86720
|
marginTop: "2px",
|
|
86717
86721
|
fontFamily: theme2.fonts.monospace
|
|
86718
|
-
}, children: eventName })] });
|
|
86722
|
+
}, children: renderWithDotBreaks(eventName) })] });
|
|
86719
86723
|
const icon = nodeData.icon || state && (((_e2 = nodeDataStates == null ? void 0 : nodeDataStates[state]) == null ? void 0 : _e2.icon) || ((_g = (_f = typeDefinition.states) == null ? void 0 : _f[state]) == null ? void 0 : _g.icon)) || typeDefinition.icon;
|
|
86720
86724
|
const getAnimationClass = () => {
|
|
86721
86725
|
switch (animationType) {
|
|
@@ -87313,6 +87317,56 @@ function convertToXYFlowEdges(edges, configuration, violations = []) {
|
|
|
87313
87317
|
};
|
|
87314
87318
|
});
|
|
87315
87319
|
}
|
|
87320
|
+
const MAX_HISTORY_SIZE = 50;
|
|
87321
|
+
function useUndoRedo() {
|
|
87322
|
+
const undoStackRef = useRef([]);
|
|
87323
|
+
const redoStackRef = useRef([]);
|
|
87324
|
+
const [canUndo, setCanUndo] = useState(false);
|
|
87325
|
+
const [canRedo, setCanRedo] = useState(false);
|
|
87326
|
+
const updateCanStates = useCallback(() => {
|
|
87327
|
+
setCanUndo(undoStackRef.current.length > 0);
|
|
87328
|
+
setCanRedo(redoStackRef.current.length > 0);
|
|
87329
|
+
}, []);
|
|
87330
|
+
const pushHistory = useCallback((entries) => {
|
|
87331
|
+
if (entries.length === 0)
|
|
87332
|
+
return;
|
|
87333
|
+
undoStackRef.current.push(entries);
|
|
87334
|
+
if (undoStackRef.current.length > MAX_HISTORY_SIZE) {
|
|
87335
|
+
undoStackRef.current.shift();
|
|
87336
|
+
}
|
|
87337
|
+
redoStackRef.current = [];
|
|
87338
|
+
updateCanStates();
|
|
87339
|
+
}, [updateCanStates]);
|
|
87340
|
+
const undo = useCallback(() => {
|
|
87341
|
+
const batch = undoStackRef.current.pop();
|
|
87342
|
+
if (!batch)
|
|
87343
|
+
return null;
|
|
87344
|
+
redoStackRef.current.push(batch);
|
|
87345
|
+
updateCanStates();
|
|
87346
|
+
return batch;
|
|
87347
|
+
}, [updateCanStates]);
|
|
87348
|
+
const redo = useCallback(() => {
|
|
87349
|
+
const batch = redoStackRef.current.pop();
|
|
87350
|
+
if (!batch)
|
|
87351
|
+
return null;
|
|
87352
|
+
undoStackRef.current.push(batch);
|
|
87353
|
+
updateCanStates();
|
|
87354
|
+
return batch;
|
|
87355
|
+
}, [updateCanStates]);
|
|
87356
|
+
const clearHistory = useCallback(() => {
|
|
87357
|
+
undoStackRef.current = [];
|
|
87358
|
+
redoStackRef.current = [];
|
|
87359
|
+
updateCanStates();
|
|
87360
|
+
}, [updateCanStates]);
|
|
87361
|
+
return {
|
|
87362
|
+
canUndo,
|
|
87363
|
+
canRedo,
|
|
87364
|
+
undo,
|
|
87365
|
+
redo,
|
|
87366
|
+
pushHistory,
|
|
87367
|
+
clearHistory
|
|
87368
|
+
};
|
|
87369
|
+
}
|
|
87316
87370
|
const TooltipPortalContext = createContext(null);
|
|
87317
87371
|
const nodeTypes = { custom: CustomNode };
|
|
87318
87372
|
const edgeTypes = { custom: CustomEdge };
|
|
@@ -87362,7 +87416,7 @@ const CenterIndicator = ({ color: color2 }) => {
|
|
|
87362
87416
|
zIndex: 5
|
|
87363
87417
|
}, children: [jsx("line", { x1: screenX, y1: screenY - size, x2: screenX, y2: screenY + size, stroke: color2, strokeWidth, opacity: 0.7 }), jsx("line", { x1: screenX - size, y1: screenY, x2: screenX + size, y2: screenY, stroke: color2, strokeWidth, opacity: 0.7 }), jsx("circle", { cx: screenX, cy: screenY, r: 3, fill: color2, opacity: 0.7 })] });
|
|
87364
87418
|
};
|
|
87365
|
-
const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges, violations = [], configName: _configName, showMinimap = false, showControls = true, showBackground = true, backgroundVariant = "lines", backgroundGap, showCenterIndicator = false, showTooltips = true, fitViewDuration = 200, highlightedNodeId, activeNodeIds, events = [], onEventProcessed, editable = false, onPendingChangesChange, onEditStateChange, editStateRef, resetVisualStateRef, onNodeClick: onNodeClickProp, fitViewToNodeIds, fitViewPadding = 0.2, draggableNodeIds, onNodeDragStop: onNodeDragStopProp, onCopy }) => {
|
|
87419
|
+
const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges, violations = [], configName: _configName, showMinimap = false, showControls = true, showBackground = true, backgroundVariant = "lines", backgroundGap, showCenterIndicator = false, showTooltips = true, fitViewDuration = 200, highlightedNodeId, activeNodeIds, events = [], onEventProcessed, editable = false, onPendingChangesChange, onEditStateChange, editStateRef, resetVisualStateRef, undoRedoFunctionsRef, pushHistory, clearHistory, undoFromStack, redoFromStack, onNodeClick: onNodeClickProp, fitViewToNodeIds, fitViewPadding = 0.2, draggableNodeIds, onNodeDragStop: onNodeDragStopProp, onCopy }) => {
|
|
87366
87420
|
const { fitView: fitView2, fitBounds, getNodes } = useReactFlow();
|
|
87367
87421
|
const updateNodeInternals2 = useUpdateNodeInternals();
|
|
87368
87422
|
const { theme: theme2 } = useTheme();
|
|
@@ -87433,6 +87487,7 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
|
|
|
87433
87487
|
onEditStateChange == null ? void 0 : onEditStateChange(editStateRef.current);
|
|
87434
87488
|
onPendingChangesChange == null ? void 0 : onPendingChangesChange(false);
|
|
87435
87489
|
setAnimationState({ nodeAnimations: {}, edgeAnimations: {} });
|
|
87490
|
+
clearHistory();
|
|
87436
87491
|
}
|
|
87437
87492
|
}, [propNodes, propEdges, editStateRef, onEditStateChange, onPendingChangesChange]);
|
|
87438
87493
|
const propNodesRef = useRef(propNodes);
|
|
@@ -87446,6 +87501,8 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
|
|
|
87446
87501
|
}, [propNodes, draggableNodeIds]);
|
|
87447
87502
|
const nodes = localNodes;
|
|
87448
87503
|
const edges = editable ? localEdges : propEdges;
|
|
87504
|
+
const xyflowNodesRef = useRef([]);
|
|
87505
|
+
const dragStartPositionsRef = useRef(/* @__PURE__ */ new Map());
|
|
87449
87506
|
const checkHasChanges = useCallback((state) => {
|
|
87450
87507
|
return state.positionChanges.size > 0 || state.dimensionChanges.size > 0 || state.nodeUpdates.size > 0 || state.deletedNodeIds.size > 0 || state.createdEdges.length > 0 || state.deletedEdges.length > 0;
|
|
87451
87508
|
}, []);
|
|
@@ -87459,12 +87516,22 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
|
|
|
87459
87516
|
const handleNodeResizeEnd = useCallback((nodeId, dimensions) => {
|
|
87460
87517
|
if (!editable)
|
|
87461
87518
|
return;
|
|
87519
|
+
const currentNode = xyflowNodesRef.current.find((n) => n.id === nodeId);
|
|
87520
|
+
const beforeDimensions = currentNode ? { width: currentNode.width ?? 0, height: currentNode.height ?? 0 } : { width: 0, height: 0 };
|
|
87521
|
+
pushHistory([
|
|
87522
|
+
{
|
|
87523
|
+
type: "dimension",
|
|
87524
|
+
nodeId,
|
|
87525
|
+
before: beforeDimensions,
|
|
87526
|
+
after: dimensions
|
|
87527
|
+
}
|
|
87528
|
+
]);
|
|
87462
87529
|
updateEditState((prev) => {
|
|
87463
87530
|
const newDimensions = new Map(prev.dimensionChanges);
|
|
87464
87531
|
newDimensions.set(nodeId, dimensions);
|
|
87465
87532
|
return { ...prev, dimensionChanges: newDimensions };
|
|
87466
87533
|
});
|
|
87467
|
-
}, [editable, updateEditState]);
|
|
87534
|
+
}, [editable, updateEditState, pushHistory]);
|
|
87468
87535
|
const graphEditContextValue = useMemo(() => ({
|
|
87469
87536
|
onNodeResizeEnd: handleNodeResizeEnd
|
|
87470
87537
|
}), [handleNodeResizeEnd]);
|
|
@@ -87660,18 +87727,25 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
|
|
|
87660
87727
|
}, [editable]);
|
|
87661
87728
|
const createEdge = useCallback((from, to, type2, sourceHandle, targetHandle) => {
|
|
87662
87729
|
const edgeId = `${from}-${to}-${type2}-${Date.now()}`;
|
|
87730
|
+
const now2 = Date.now();
|
|
87663
87731
|
const newEdge = {
|
|
87664
87732
|
id: edgeId,
|
|
87665
87733
|
type: type2,
|
|
87666
87734
|
from,
|
|
87667
87735
|
to,
|
|
87668
87736
|
data: {},
|
|
87669
|
-
createdAt:
|
|
87670
|
-
updatedAt:
|
|
87737
|
+
createdAt: now2,
|
|
87738
|
+
updatedAt: now2,
|
|
87671
87739
|
sourceHandle,
|
|
87672
87740
|
targetHandle
|
|
87673
87741
|
};
|
|
87674
87742
|
setLocalEdges((prev) => [...prev, newEdge]);
|
|
87743
|
+
pushHistory([
|
|
87744
|
+
{
|
|
87745
|
+
type: "edgeCreate",
|
|
87746
|
+
edge: newEdge
|
|
87747
|
+
}
|
|
87748
|
+
]);
|
|
87675
87749
|
updateEditState((prev) => ({
|
|
87676
87750
|
...prev,
|
|
87677
87751
|
createdEdges: [
|
|
@@ -87679,7 +87753,7 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
|
|
|
87679
87753
|
{ id: edgeId, from, to, type: type2, sourceHandle, targetHandle }
|
|
87680
87754
|
]
|
|
87681
87755
|
}));
|
|
87682
|
-
}, [updateEditState]);
|
|
87756
|
+
}, [updateEditState, pushHistory]);
|
|
87683
87757
|
const handleConnect = useCallback((connection) => {
|
|
87684
87758
|
if (!editable || !connection.source || !connection.target)
|
|
87685
87759
|
return;
|
|
@@ -87945,6 +88019,9 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
|
|
|
87945
88019
|
return edges.map((e) => e.id).sort().join(",");
|
|
87946
88020
|
}, [edges]);
|
|
87947
88021
|
const [xyflowLocalNodes, setXyflowLocalNodes] = useState(xyflowNodesBase);
|
|
88022
|
+
useEffect(() => {
|
|
88023
|
+
xyflowNodesRef.current = xyflowLocalNodes;
|
|
88024
|
+
}, [xyflowLocalNodes]);
|
|
87948
88025
|
const prevBaseNodesKeyRef = useRef(baseNodesKey);
|
|
87949
88026
|
useEffect(() => {
|
|
87950
88027
|
if (prevBaseNodesKeyRef.current !== baseNodesKey) {
|
|
@@ -88006,6 +88083,128 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
|
|
|
88006
88083
|
onNodeDragStopProp(node2.id, node2.position);
|
|
88007
88084
|
}
|
|
88008
88085
|
}, [onNodeDragStopProp]);
|
|
88086
|
+
const applyUndo = useCallback(() => {
|
|
88087
|
+
const batch = undoFromStack();
|
|
88088
|
+
if (!batch)
|
|
88089
|
+
return;
|
|
88090
|
+
for (const entry of batch.slice().reverse()) {
|
|
88091
|
+
switch (entry.type) {
|
|
88092
|
+
case "position":
|
|
88093
|
+
setXyflowLocalNodes((nodes2) => nodes2.map((n) => n.id === entry.nodeId ? { ...n, position: entry.before } : n));
|
|
88094
|
+
updateEditState((prev) => {
|
|
88095
|
+
const newPositions = new Map(prev.positionChanges);
|
|
88096
|
+
newPositions.set(entry.nodeId, entry.before);
|
|
88097
|
+
return { ...prev, positionChanges: newPositions };
|
|
88098
|
+
});
|
|
88099
|
+
break;
|
|
88100
|
+
case "dimension":
|
|
88101
|
+
setXyflowLocalNodes((nodes2) => nodes2.map((n) => n.id === entry.nodeId ? { ...n, width: entry.before.width, height: entry.before.height } : n));
|
|
88102
|
+
updateEditState((prev) => {
|
|
88103
|
+
const newDimensions = new Map(prev.dimensionChanges);
|
|
88104
|
+
newDimensions.set(entry.nodeId, entry.before);
|
|
88105
|
+
return { ...prev, dimensionChanges: newDimensions };
|
|
88106
|
+
});
|
|
88107
|
+
break;
|
|
88108
|
+
case "edgeCreate":
|
|
88109
|
+
setLocalEdges((edges2) => edges2.filter((e) => e.id !== entry.edge.id));
|
|
88110
|
+
updateEditState((prev) => ({
|
|
88111
|
+
...prev,
|
|
88112
|
+
createdEdges: prev.createdEdges.filter((e) => e.id !== entry.edge.id)
|
|
88113
|
+
}));
|
|
88114
|
+
break;
|
|
88115
|
+
case "edgeDelete":
|
|
88116
|
+
setLocalEdges((edges2) => [...edges2, entry.edge]);
|
|
88117
|
+
updateEditState((prev) => ({
|
|
88118
|
+
...prev,
|
|
88119
|
+
deletedEdges: prev.deletedEdges.filter((e) => e.id !== entry.edge.id)
|
|
88120
|
+
}));
|
|
88121
|
+
break;
|
|
88122
|
+
}
|
|
88123
|
+
}
|
|
88124
|
+
}, [undoFromStack, updateEditState]);
|
|
88125
|
+
const applyRedo = useCallback(() => {
|
|
88126
|
+
const batch = redoFromStack();
|
|
88127
|
+
if (!batch)
|
|
88128
|
+
return;
|
|
88129
|
+
for (const entry of batch) {
|
|
88130
|
+
switch (entry.type) {
|
|
88131
|
+
case "position":
|
|
88132
|
+
setXyflowLocalNodes((nodes2) => nodes2.map((n) => n.id === entry.nodeId ? { ...n, position: entry.after } : n));
|
|
88133
|
+
updateEditState((prev) => {
|
|
88134
|
+
const newPositions = new Map(prev.positionChanges);
|
|
88135
|
+
newPositions.set(entry.nodeId, entry.after);
|
|
88136
|
+
return { ...prev, positionChanges: newPositions };
|
|
88137
|
+
});
|
|
88138
|
+
break;
|
|
88139
|
+
case "dimension":
|
|
88140
|
+
setXyflowLocalNodes((nodes2) => nodes2.map((n) => n.id === entry.nodeId ? { ...n, width: entry.after.width, height: entry.after.height } : n));
|
|
88141
|
+
updateEditState((prev) => {
|
|
88142
|
+
const newDimensions = new Map(prev.dimensionChanges);
|
|
88143
|
+
newDimensions.set(entry.nodeId, entry.after);
|
|
88144
|
+
return { ...prev, dimensionChanges: newDimensions };
|
|
88145
|
+
});
|
|
88146
|
+
break;
|
|
88147
|
+
case "edgeCreate":
|
|
88148
|
+
setLocalEdges((edges2) => [...edges2, entry.edge]);
|
|
88149
|
+
updateEditState((prev) => ({
|
|
88150
|
+
...prev,
|
|
88151
|
+
createdEdges: [
|
|
88152
|
+
...prev.createdEdges,
|
|
88153
|
+
{
|
|
88154
|
+
id: entry.edge.id,
|
|
88155
|
+
from: entry.edge.from,
|
|
88156
|
+
to: entry.edge.to,
|
|
88157
|
+
type: entry.edge.type,
|
|
88158
|
+
sourceHandle: entry.edge.sourceHandle,
|
|
88159
|
+
targetHandle: entry.edge.targetHandle
|
|
88160
|
+
}
|
|
88161
|
+
]
|
|
88162
|
+
}));
|
|
88163
|
+
break;
|
|
88164
|
+
case "edgeDelete":
|
|
88165
|
+
setLocalEdges((edges2) => edges2.filter((e) => e.id !== entry.edge.id));
|
|
88166
|
+
updateEditState((prev) => ({
|
|
88167
|
+
...prev,
|
|
88168
|
+
deletedEdges: [
|
|
88169
|
+
...prev.deletedEdges,
|
|
88170
|
+
{
|
|
88171
|
+
id: entry.edge.id,
|
|
88172
|
+
from: entry.edge.from,
|
|
88173
|
+
to: entry.edge.to,
|
|
88174
|
+
type: entry.edge.type
|
|
88175
|
+
}
|
|
88176
|
+
]
|
|
88177
|
+
}));
|
|
88178
|
+
break;
|
|
88179
|
+
}
|
|
88180
|
+
}
|
|
88181
|
+
}, [redoFromStack, updateEditState]);
|
|
88182
|
+
useEffect(() => {
|
|
88183
|
+
if (!editable)
|
|
88184
|
+
return;
|
|
88185
|
+
const handleKeyDown = (e) => {
|
|
88186
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "z") {
|
|
88187
|
+
e.preventDefault();
|
|
88188
|
+
if (e.shiftKey) {
|
|
88189
|
+
applyRedo();
|
|
88190
|
+
} else {
|
|
88191
|
+
applyUndo();
|
|
88192
|
+
}
|
|
88193
|
+
}
|
|
88194
|
+
if (e.ctrlKey && e.key === "y") {
|
|
88195
|
+
e.preventDefault();
|
|
88196
|
+
applyRedo();
|
|
88197
|
+
}
|
|
88198
|
+
};
|
|
88199
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
88200
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
88201
|
+
}, [editable, applyUndo, applyRedo]);
|
|
88202
|
+
useEffect(() => {
|
|
88203
|
+
undoRedoFunctionsRef.current = {
|
|
88204
|
+
applyUndo,
|
|
88205
|
+
applyRedo
|
|
88206
|
+
};
|
|
88207
|
+
}, [applyUndo, applyRedo, undoRedoFunctionsRef]);
|
|
88009
88208
|
const handleNodesChange = useCallback((changes) => {
|
|
88010
88209
|
const hasDraggableNodes2 = draggableNodeIds && draggableNodeIds.size > 0;
|
|
88011
88210
|
if (!editable && !hasDraggableNodes2)
|
|
@@ -88050,8 +88249,35 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
|
|
|
88050
88249
|
}));
|
|
88051
88250
|
});
|
|
88052
88251
|
}
|
|
88053
|
-
const
|
|
88252
|
+
const dragStartChanges = changes.filter((change) => change.type === "position" && "id" in change && "dragging" in change && change.dragging === true);
|
|
88253
|
+
for (const change of dragStartChanges) {
|
|
88254
|
+
if (!dragStartPositionsRef.current.has(change.id)) {
|
|
88255
|
+
const currentNode = xyflowNodesRef.current.find((n) => n.id === change.id);
|
|
88256
|
+
if (currentNode) {
|
|
88257
|
+
dragStartPositionsRef.current.set(change.id, {
|
|
88258
|
+
x: currentNode.position.x,
|
|
88259
|
+
y: currentNode.position.y
|
|
88260
|
+
});
|
|
88261
|
+
}
|
|
88262
|
+
}
|
|
88263
|
+
}
|
|
88264
|
+
const positionChanges = changes.filter((change) => change.type === "position" && "id" in change && "position" in change && change.position !== void 0 && "dragging" in change && change.dragging === false);
|
|
88054
88265
|
if (positionChanges.length > 0) {
|
|
88266
|
+
const historyEntries = [];
|
|
88267
|
+
for (const change of positionChanges) {
|
|
88268
|
+
const beforePos = dragStartPositionsRef.current.get(change.id) ?? { x: 0, y: 0 };
|
|
88269
|
+
historyEntries.push({
|
|
88270
|
+
type: "position",
|
|
88271
|
+
nodeId: change.id,
|
|
88272
|
+
before: beforePos,
|
|
88273
|
+
after: {
|
|
88274
|
+
x: Math.round(change.position.x),
|
|
88275
|
+
y: Math.round(change.position.y)
|
|
88276
|
+
}
|
|
88277
|
+
});
|
|
88278
|
+
dragStartPositionsRef.current.delete(change.id);
|
|
88279
|
+
}
|
|
88280
|
+
pushHistory(historyEntries);
|
|
88055
88281
|
updateEditState((prev) => {
|
|
88056
88282
|
const newPositions = new Map(prev.positionChanges);
|
|
88057
88283
|
for (const change of positionChanges) {
|
|
@@ -88063,7 +88289,7 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
|
|
|
88063
88289
|
return { ...prev, positionChanges: newPositions };
|
|
88064
88290
|
});
|
|
88065
88291
|
}
|
|
88066
|
-
}, [editable, updateEditState, selectedNodeIds, draggableNodeIds]);
|
|
88292
|
+
}, [editable, updateEditState, selectedNodeIds, draggableNodeIds, pushHistory]);
|
|
88067
88293
|
const xyflowEdgesBase = useMemo(() => {
|
|
88068
88294
|
const converted = convertToXYFlowEdges(edges, configuration, violations);
|
|
88069
88295
|
const filtered = converted.filter((edge) => {
|
|
@@ -88349,6 +88575,8 @@ const GraphRenderer = forwardRef((props2, ref) => {
|
|
|
88349
88575
|
const canvasData = useCanvasToLegacy(canvas, library);
|
|
88350
88576
|
const editStateRef = useRef(createEmptyEditState());
|
|
88351
88577
|
const resetVisualStateRef = useRef(null);
|
|
88578
|
+
const { canUndo: canUndoState, canRedo: canRedoState, undo: undoFromStack, redo: redoFromStack, pushHistory, clearHistory } = useUndoRedo();
|
|
88579
|
+
const undoRedoFunctionsRef = useRef(null);
|
|
88352
88580
|
useImperativeHandle(ref, () => ({
|
|
88353
88581
|
getPendingChanges: () => {
|
|
88354
88582
|
const state = editStateRef.current;
|
|
@@ -88381,12 +88609,23 @@ const GraphRenderer = forwardRef((props2, ref) => {
|
|
|
88381
88609
|
var _a;
|
|
88382
88610
|
editStateRef.current = createEmptyEditState();
|
|
88383
88611
|
(_a = resetVisualStateRef.current) == null ? void 0 : _a.call(resetVisualStateRef);
|
|
88612
|
+
clearHistory();
|
|
88384
88613
|
},
|
|
88385
88614
|
hasUnsavedChanges: () => {
|
|
88386
88615
|
const state = editStateRef.current;
|
|
88387
88616
|
return state.positionChanges.size > 0 || state.dimensionChanges.size > 0 || state.nodeUpdates.size > 0 || state.deletedNodeIds.size > 0 || state.createdEdges.length > 0 || state.deletedEdges.length > 0;
|
|
88617
|
+
},
|
|
88618
|
+
canUndo: () => canUndoState,
|
|
88619
|
+
canRedo: () => canRedoState,
|
|
88620
|
+
undo: () => {
|
|
88621
|
+
var _a;
|
|
88622
|
+
return (_a = undoRedoFunctionsRef.current) == null ? void 0 : _a.applyUndo();
|
|
88623
|
+
},
|
|
88624
|
+
redo: () => {
|
|
88625
|
+
var _a;
|
|
88626
|
+
return (_a = undoRedoFunctionsRef.current) == null ? void 0 : _a.applyRedo();
|
|
88388
88627
|
}
|
|
88389
|
-
}), []);
|
|
88628
|
+
}), [canUndoState, canRedoState, clearHistory]);
|
|
88390
88629
|
if (!canvasData) {
|
|
88391
88630
|
return jsx("div", { className, style: {
|
|
88392
88631
|
width,
|
|
@@ -88400,7 +88639,7 @@ const GraphRenderer = forwardRef((props2, ref) => {
|
|
|
88400
88639
|
}
|
|
88401
88640
|
const { configuration, nodes, edges } = canvasData;
|
|
88402
88641
|
const { violations, configName, showMinimap, showControls, showBackground, backgroundVariant, backgroundGap, showCenterIndicator, showTooltips, fitViewDuration, highlightedNodeId, activeNodeIds, events, onEventProcessed, editable, onPendingChangesChange, onNodeClick, fitViewToNodeIds, fitViewPadding, draggableNodeIds, onNodeDragStop, onCopy } = props2;
|
|
88403
|
-
return jsx("div", { ref: containerRef, className, style: { width, height, position: "relative" }, children: jsx(TooltipPortalContext.Provider, { value: portalTarget, children: jsx(ReactFlowProvider, { children: jsx(GraphRendererInner, { configuration, nodes, edges, violations, configName, showMinimap, showControls, showBackground, backgroundVariant, backgroundGap, showCenterIndicator, showTooltips, fitViewDuration, highlightedNodeId, activeNodeIds, events, onEventProcessed, editable, onPendingChangesChange, editStateRef, resetVisualStateRef, onNodeClick, fitViewToNodeIds, fitViewPadding, draggableNodeIds, onNodeDragStop, onCopy }) }) }) });
|
|
88642
|
+
return jsx("div", { ref: containerRef, className, style: { width, height, position: "relative" }, children: jsx(TooltipPortalContext.Provider, { value: portalTarget, children: jsx(ReactFlowProvider, { children: jsx(GraphRendererInner, { configuration, nodes, edges, violations, configName, showMinimap, showControls, showBackground, backgroundVariant, backgroundGap, showCenterIndicator, showTooltips, fitViewDuration, highlightedNodeId, activeNodeIds, events, onEventProcessed, editable, onPendingChangesChange, editStateRef, resetVisualStateRef, undoRedoFunctionsRef, pushHistory, clearHistory, undoFromStack, redoFromStack, onNodeClick, fitViewToNodeIds, fitViewPadding, draggableNodeIds, onNodeDragStop, onCopy }) }) }) });
|
|
88404
88643
|
});
|
|
88405
88644
|
GraphRenderer.displayName = "GraphRenderer";
|
|
88406
88645
|
const DEFAULT_NODE_WIDTH = 200;
|
|
@@ -102092,10 +102331,11 @@ const TraceListPanel = ({
|
|
|
102092
102331
|
const filteredTraces = React__default.useMemo(() => {
|
|
102093
102332
|
return traces.filter((trace2) => {
|
|
102094
102333
|
const hasScenarioMatches = trace2.scenarioMatches && trace2.scenarioMatches.length > 0;
|
|
102095
|
-
|
|
102334
|
+
const isKnown = isTraceMatched(trace2);
|
|
102335
|
+
if (traceFilterMode === "known" && !isKnown) {
|
|
102096
102336
|
return false;
|
|
102097
102337
|
}
|
|
102098
|
-
if (traceFilterMode === "unknown" &&
|
|
102338
|
+
if (traceFilterMode === "unknown" && isKnown) {
|
|
102099
102339
|
return false;
|
|
102100
102340
|
}
|
|
102101
102341
|
if (!hasScenarioMatches) {
|