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.

42 lines 2.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DomainNode = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const reactflow_1 = require("reactflow"); const DomainNode = ({ data, selected, }) => { const getNodeColor = () => { if (data.isInCycle) return '#ef4444'; // Red for cycles switch (data.domainType) { case 'core': return '#f59e0b'; // Amber case 'shared': return '#3b82f6'; // Blue default: return '#10b981'; // Emerald } }; const nodeSize = data.settings.nodeSize || 80; return ((0, jsx_runtime_1.jsxs)("div", { style: { width: nodeSize, height: nodeSize, borderRadius: '50%', backgroundColor: getNodeColor(), border: selected || data.isSelected ? '3px solid #1f2937' : '2px solid #ffffff', display: 'flex', alignItems: 'center', justifyContent: 'center', color: 'white', fontWeight: 'bold', fontSize: '12px', textAlign: 'center', boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1)', cursor: 'pointer', transition: 'all 0.2s ease', transform: selected || data.isSelected ? 'scale(1.1)' : 'scale(1)', }, title: `${data.label} (${data.domainType})`, children: [data.settings.showLabels && ((0, jsx_runtime_1.jsx)("div", { style: { padding: '4px', lineHeight: '1.2' }, children: data.label })), (0, jsx_runtime_1.jsx)(reactflow_1.Handle, { type: "target", position: reactflow_1.Position.Top, style: { background: '#555', width: 8, height: 8 } }), (0, jsx_runtime_1.jsx)(reactflow_1.Handle, { type: "source", position: reactflow_1.Position.Bottom, style: { background: '#555', width: 8, height: 8 } }), (0, jsx_runtime_1.jsx)(reactflow_1.Handle, { type: "target", position: reactflow_1.Position.Left, style: { background: '#555', width: 8, height: 8 } }), (0, jsx_runtime_1.jsx)(reactflow_1.Handle, { type: "source", position: reactflow_1.Position.Right, style: { background: '#555', width: 8, height: 8 } })] })); }; exports.DomainNode = DomainNode; //# sourceMappingURL=DomainNode.js.map