@industry-theme/repository-composition-panels 0.2.52 → 0.2.54
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/panels.bundle.js +16 -75
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +14 -8
package/dist/panels.bundle.js
CHANGED
|
@@ -13264,6 +13264,10 @@ function resolveCanvasColor(color2) {
|
|
|
13264
13264
|
if (typeof color2 === "number") {
|
|
13265
13265
|
return CANVAS_COLOR_PRESETS[color2];
|
|
13266
13266
|
}
|
|
13267
|
+
const numericValue = parseInt(color2, 10);
|
|
13268
|
+
if (!isNaN(numericValue) && numericValue >= 1 && numericValue <= 6) {
|
|
13269
|
+
return CANVAS_COLOR_PRESETS[numericValue];
|
|
13270
|
+
}
|
|
13267
13271
|
return color2;
|
|
13268
13272
|
}
|
|
13269
13273
|
function sideToHandle(side) {
|
|
@@ -54528,8 +54532,8 @@ const COMMON_ICONS = [
|
|
|
54528
54532
|
"GitMerge",
|
|
54529
54533
|
"GitPullRequest"
|
|
54530
54534
|
];
|
|
54531
|
-
const NodeInfoPanel = ({ node, typeDefinition, availableNodeTypes, onClose, onDelete, onUpdate,
|
|
54532
|
-
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j
|
|
54535
|
+
const NodeInfoPanel = ({ node, typeDefinition, availableNodeTypes, onClose, onDelete, onUpdate, resolveEventRef }) => {
|
|
54536
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j;
|
|
54533
54537
|
const { theme } = useTheme();
|
|
54534
54538
|
const nodeColor = ((_a = node.data) == null ? void 0 : _a.color) || (typeDefinition == null ? void 0 : typeDefinition.color) || theme.colors.primary;
|
|
54535
54539
|
const canEdit = Boolean(onUpdate);
|
|
@@ -54570,12 +54574,10 @@ const NodeInfoPanel = ({ node, typeDefinition, availableNodeTypes, onClose, onDe
|
|
|
54570
54574
|
"eventRef"
|
|
54571
54575
|
// Handle separately in Event section
|
|
54572
54576
|
];
|
|
54573
|
-
const
|
|
54574
|
-
const
|
|
54575
|
-
const eventRef = (_f = node.data) == null ? void 0 : _f.eventRef;
|
|
54577
|
+
const eventInfo = (_d = node.data) == null ? void 0 : _d.event;
|
|
54578
|
+
const eventRef = (_e2 = node.data) == null ? void 0 : _e2.eventRef;
|
|
54576
54579
|
const resolvedEvent = eventRef && resolveEventRef ? resolveEventRef(eventRef) : void 0;
|
|
54577
54580
|
const nodeDataEntries = node.data ? Object.entries(node.data).filter(([key]) => !internalFields.includes(key)) : [];
|
|
54578
|
-
const sources = ((_g = node.data) == null ? void 0 : _g.sources) || [];
|
|
54579
54581
|
const handleTypeChange = (newType) => {
|
|
54580
54582
|
if (onUpdate && newType !== node.type) {
|
|
54581
54583
|
onUpdate(node.id, { type: newType });
|
|
@@ -54650,28 +54652,7 @@ const NodeInfoPanel = ({ node, typeDefinition, availableNodeTypes, onClose, onDe
|
|
|
54650
54652
|
e.currentTarget.style.backgroundColor = theme.colors.muted;
|
|
54651
54653
|
}, onMouseLeave: (e) => {
|
|
54652
54654
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
54653
|
-
}, children: "×" })] })] }), jsxs("div", {
|
|
54654
|
-
fontSize: theme.fontSizes[0],
|
|
54655
|
-
fontWeight: theme.fontWeights.semibold,
|
|
54656
|
-
fontFamily: theme.fonts.body,
|
|
54657
|
-
padding: "3px 8px",
|
|
54658
|
-
borderRadius: "4px",
|
|
54659
|
-
textTransform: "uppercase",
|
|
54660
|
-
color: "white",
|
|
54661
|
-
backgroundColor: otelInfo.kind === "type" ? "#4A90E2" : otelInfo.kind === "service" ? "#7ED321" : otelInfo.kind === "instance" ? "#9B59B6" : "#888"
|
|
54662
|
-
}, children: otelInfo.kind }), otelInfo.category && jsx("span", { style: {
|
|
54663
|
-
fontSize: theme.fontSizes[0],
|
|
54664
|
-
fontFamily: theme.fonts.body,
|
|
54665
|
-
color: theme.colors.textSecondary
|
|
54666
|
-
}, children: otelInfo.category }), otelInfo.isNew && jsx("span", { style: {
|
|
54667
|
-
fontSize: theme.fontSizes[0],
|
|
54668
|
-
fontWeight: theme.fontWeights.semibold,
|
|
54669
|
-
fontFamily: theme.fonts.body,
|
|
54670
|
-
padding: "2px 6px",
|
|
54671
|
-
borderRadius: "3px",
|
|
54672
|
-
backgroundColor: "#F5A623",
|
|
54673
|
-
color: "white"
|
|
54674
|
-
}, children: "NEW" })] })] }), (eventInfo || eventRef || resolvedEvent) && jsx("div", { style: { marginBottom: "12px", marginTop: "-4px" }, children: (() => {
|
|
54655
|
+
}, children: "×" })] })] }), jsxs("div", { children: [((_f = node.data) == null ? void 0 : _f.description) && jsxs("div", { style: { marginBottom: "12px" }, children: [jsx("div", { style: { fontSize: theme.fontSizes[0], fontFamily: theme.fonts.body, color: theme.colors.textSecondary, marginBottom: "4px" }, children: "Description" }), jsx("div", { style: { fontSize: theme.fontSizes[0], fontFamily: theme.fonts.body }, children: String(node.data.description) })] }), (eventInfo || eventRef || resolvedEvent) && jsx("div", { style: { marginBottom: "12px", marginTop: "-4px" }, children: (() => {
|
|
54675
54656
|
const displayEvent = resolvedEvent || eventInfo;
|
|
54676
54657
|
if (displayEvent) {
|
|
54677
54658
|
return jsxs("div", { children: [jsx("div", { style: {
|
|
@@ -54723,47 +54704,7 @@ const NodeInfoPanel = ({ node, typeDefinition, availableNodeTypes, onClose, onDe
|
|
|
54723
54704
|
}, children: eventRef });
|
|
54724
54705
|
}
|
|
54725
54706
|
return null;
|
|
54726
|
-
})() })] }),
|
|
54727
|
-
console.log("Source clicked:", source, "from node:", node.id);
|
|
54728
|
-
onSourceClick(node.id, source);
|
|
54729
|
-
}, style: {
|
|
54730
|
-
fontSize: theme.fontSizes[0],
|
|
54731
|
-
fontFamily: "monospace",
|
|
54732
|
-
padding: "6px 10px",
|
|
54733
|
-
backgroundColor: theme.colors.muted,
|
|
54734
|
-
borderRadius: "4px",
|
|
54735
|
-
color: theme.colors.primary,
|
|
54736
|
-
border: `1px solid ${theme.colors.border}`,
|
|
54737
|
-
cursor: "pointer",
|
|
54738
|
-
transition: "all 0.15s",
|
|
54739
|
-
textAlign: "left",
|
|
54740
|
-
width: "100%",
|
|
54741
|
-
textDecoration: "underline",
|
|
54742
|
-
textDecorationStyle: "dotted",
|
|
54743
|
-
textDecorationColor: theme.colors.primary
|
|
54744
|
-
}, onMouseEnter: (e) => {
|
|
54745
|
-
e.currentTarget.style.backgroundColor = theme.colors.primary;
|
|
54746
|
-
e.currentTarget.style.color = theme.colors.background;
|
|
54747
|
-
e.currentTarget.style.borderColor = theme.colors.primary;
|
|
54748
|
-
e.currentTarget.style.textDecoration = "underline";
|
|
54749
|
-
e.currentTarget.style.textDecorationColor = theme.colors.background;
|
|
54750
|
-
}, onMouseLeave: (e) => {
|
|
54751
|
-
e.currentTarget.style.backgroundColor = theme.colors.muted;
|
|
54752
|
-
e.currentTarget.style.color = theme.colors.primary;
|
|
54753
|
-
e.currentTarget.style.borderColor = theme.colors.border;
|
|
54754
|
-
e.currentTarget.style.textDecoration = "underline";
|
|
54755
|
-
e.currentTarget.style.textDecorationStyle = "dotted";
|
|
54756
|
-
e.currentTarget.style.textDecorationColor = theme.colors.primary;
|
|
54757
|
-
}, children: source }, index2) : jsx("span", { style: {
|
|
54758
|
-
fontSize: theme.fontSizes[0],
|
|
54759
|
-
fontFamily: "monospace",
|
|
54760
|
-
padding: "6px 10px",
|
|
54761
|
-
backgroundColor: theme.colors.muted,
|
|
54762
|
-
borderRadius: "4px",
|
|
54763
|
-
color: theme.colors.textSecondary,
|
|
54764
|
-
display: "block",
|
|
54765
|
-
border: `1px solid ${theme.colors.border}`
|
|
54766
|
-
}, children: source }, index2)) })] }) })] }), canEdit && jsxs("button", { onClick: () => setShowDetails(!showDetails), style: {
|
|
54707
|
+
})() })] }), canEdit && jsxs("button", { onClick: () => setShowDetails(!showDetails), style: {
|
|
54767
54708
|
width: "100%",
|
|
54768
54709
|
padding: "8px",
|
|
54769
54710
|
backgroundColor: theme.colors.surface,
|
|
@@ -54845,11 +54786,11 @@ const NodeInfoPanel = ({ node, typeDefinition, availableNodeTypes, onClose, onDe
|
|
|
54845
54786
|
fontSize: theme.fontSizes[0],
|
|
54846
54787
|
fontFamily: theme.fonts.body,
|
|
54847
54788
|
padding: "4px 8px",
|
|
54848
|
-
backgroundColor: ((
|
|
54789
|
+
backgroundColor: ((_h = (_g = typeDefinition == null ? void 0 : typeDefinition.states) == null ? void 0 : _g[node.state]) == null ? void 0 : _h.color) || theme.colors.secondary,
|
|
54849
54790
|
color: theme.colors.background,
|
|
54850
54791
|
borderRadius: "4px",
|
|
54851
54792
|
display: "inline-block"
|
|
54852
|
-
}, children: ((
|
|
54793
|
+
}, children: ((_j = (_i = typeDefinition == null ? void 0 : typeDefinition.states) == null ? void 0 : _i[node.state]) == null ? void 0 : _j.label) || node.state })] }), hasSchemaFields && displayFields.filter((f) => f.field !== nameField).length > 0 && jsxs("div", { style: { marginBottom: "12px" }, children: [jsx("div", { style: {
|
|
54853
54794
|
fontSize: theme.fontSizes[0],
|
|
54854
54795
|
fontFamily: theme.fonts.body,
|
|
54855
54796
|
color: theme.colors.textSecondary,
|
|
@@ -55097,7 +55038,7 @@ const CenterIndicator = ({ color: color2 }) => {
|
|
|
55097
55038
|
zIndex: 5
|
|
55098
55039
|
}, 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 })] });
|
|
55099
55040
|
};
|
|
55100
|
-
const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges, violations = [], configName: _configName, showMinimap = false, showControls = true, showBackground = true, backgroundVariant = "dots", backgroundGap, showCenterIndicator = false, showTooltips = true, fitViewDuration = 200, highlightedNodeId, activeNodeIds, events = [], onEventProcessed, editable = false, onPendingChangesChange, onEditStateChange, editStateRef,
|
|
55041
|
+
const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges, violations = [], configName: _configName, showMinimap = false, showControls = true, showBackground = true, backgroundVariant = "dots", backgroundGap, showCenterIndicator = false, showTooltips = true, fitViewDuration = 200, highlightedNodeId, activeNodeIds, events = [], onEventProcessed, editable = false, onPendingChangesChange, onEditStateChange, editStateRef, onNodeClick: onNodeClickProp, showNodeDetailPanel, resolveEventRef }) => {
|
|
55101
55042
|
const { fitView: fitView2 } = useReactFlow();
|
|
55102
55043
|
const updateNodeInternals2 = useUpdateNodeInternals();
|
|
55103
55044
|
const { theme } = useTheme();
|
|
@@ -55768,7 +55709,7 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
|
|
|
55768
55709
|
var _a;
|
|
55769
55710
|
const nodeData = node.data;
|
|
55770
55711
|
return ((_a = nodeData == null ? void 0 : nodeData.typeDefinition) == null ? void 0 : _a.color) || theme.colors.secondary;
|
|
55771
|
-
}, nodeBorderRadius: 2, pannable: true, zoomable: true }), showCenterIndicator && jsx(CenterIndicator, { color: theme.colors.textMuted })] }, `${baseNodesKey}-${baseEdgesKey}`), selectedNodeIds.size >= 2 && showNodePanel && showNodeDetailPanel !== false && jsx(SelectionSidebar, { selectedNodeIds, nodes, nodeTypeDefinitions: configuration.nodeTypes, onClose: onCloseNodeInfoPanel }), selectedEdgeIds.size === 1 && selectedEdge && selectedEdgeTypeDefinition && showEdgePanel && jsx(EdgeInfoPanel, { edge: selectedEdge, typeDefinition: selectedEdgeTypeDefinition, sourceNodeId: selectedEdge.from, targetNodeId: selectedEdge.to, onClose: onCloseEdgeInfoPanel, onDelete: editable ? handleEdgeDelete : void 0, onUpdateSides: editable ? handleUpdateEdgeSides : void 0 }), selectedNodeIds.size === 1 && selectedNode && selectedNodeTypeDefinition && showNodePanel && showNodeDetailPanel !== false && jsx(NodeInfoPanel, { node: selectedNode, typeDefinition: selectedNodeTypeDefinition, availableNodeTypes: configuration.nodeTypes, onClose: onCloseNodeInfoPanel, onDelete: editable ? handleNodeDelete : void 0, onUpdate: editable ? handleNodeUpdate : void 0,
|
|
55712
|
+
}, nodeBorderRadius: 2, pannable: true, zoomable: true }), showCenterIndicator && jsx(CenterIndicator, { color: theme.colors.textMuted })] }, `${baseNodesKey}-${baseEdgesKey}`), selectedNodeIds.size >= 2 && showNodePanel && showNodeDetailPanel !== false && jsx(SelectionSidebar, { selectedNodeIds, nodes, nodeTypeDefinitions: configuration.nodeTypes, onClose: onCloseNodeInfoPanel }), selectedEdgeIds.size === 1 && selectedEdge && selectedEdgeTypeDefinition && showEdgePanel && jsx(EdgeInfoPanel, { edge: selectedEdge, typeDefinition: selectedEdgeTypeDefinition, sourceNodeId: selectedEdge.from, targetNodeId: selectedEdge.to, onClose: onCloseEdgeInfoPanel, onDelete: editable ? handleEdgeDelete : void 0, onUpdateSides: editable ? handleUpdateEdgeSides : void 0 }), selectedNodeIds.size === 1 && selectedNode && selectedNodeTypeDefinition && showNodePanel && showNodeDetailPanel !== false && jsx(NodeInfoPanel, { node: selectedNode, typeDefinition: selectedNodeTypeDefinition, availableNodeTypes: configuration.nodeTypes, onClose: onCloseNodeInfoPanel, onDelete: editable ? handleNodeDelete : void 0, onUpdate: editable ? handleNodeUpdate : void 0, resolveEventRef }), pendingConnection && jsxs("div", { style: {
|
|
55772
55713
|
position: "absolute",
|
|
55773
55714
|
top: "50%",
|
|
55774
55715
|
left: "50%",
|
|
@@ -55977,8 +55918,8 @@ const GraphRenderer = forwardRef((props, ref) => {
|
|
|
55977
55918
|
}, children: jsx("p", { children: "No canvas data provided." }) });
|
|
55978
55919
|
}
|
|
55979
55920
|
const { configuration, nodes, edges } = canvasData;
|
|
55980
|
-
const { violations, configName, showMinimap, showControls, showBackground, backgroundVariant, backgroundGap, showCenterIndicator, showTooltips, fitViewDuration, highlightedNodeId, activeNodeIds, events, onEventProcessed, editable, onPendingChangesChange,
|
|
55981
|
-
return jsx("div", { className, style: { width, height, position: "relative" }, 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,
|
|
55921
|
+
const { violations, configName, showMinimap, showControls, showBackground, backgroundVariant, backgroundGap, showCenterIndicator, showTooltips, fitViewDuration, highlightedNodeId, activeNodeIds, events, onEventProcessed, editable, onPendingChangesChange, onNodeClick, showNodeDetailPanel, resolveEventRef } = props;
|
|
55922
|
+
return jsx("div", { className, style: { width, height, position: "relative" }, 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, onNodeClick, showNodeDetailPanel, resolveEventRef }) }) });
|
|
55982
55923
|
});
|
|
55983
55924
|
GraphRenderer.displayName = "GraphRenderer";
|
|
55984
55925
|
function dependencyTreeToCanvas(packages, options = {}) {
|