UNPKG

ruch

Version:

Revolutionary React TypeScript CLI with hexagonal architecture & AI-powered development assistance. Create maintainable, scalable applications with domain-driven design and integrated AI tooling.

30 lines 1.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DependencyEdge = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const reactflow_1 = require("reactflow"); const DependencyEdge = ({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data, selected, }) => { const [edgePath] = (0, reactflow_1.getBezierPath)({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, }); const getEdgeColor = () => { if (selected || data?.isSelected) return '#1f2937'; return data?.dependencyType === 'direct-import' ? '#64748b' : '#94a3b8'; }; const strokeWidth = (data?.settings.edgeThickness || 2) * (selected || data?.isSelected ? 1.5 : 1); return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { id: id, style: { stroke: getEdgeColor(), strokeWidth, fill: 'none', cursor: 'pointer', }, className: "react-flow__edge-path", d: edgePath }), data?.metadata && ((0, jsx_runtime_1.jsxs)("title", { children: [`${data.dependencyType} dependency`, data.metadata.path && ` in ${data.metadata.path}`, data.metadata.line && ` at line ${data.metadata.line}`] }))] })); }; exports.DependencyEdge = DependencyEdge; //# sourceMappingURL=DependencyEdge.js.map