react-cosmos-diagram 0.2.0 → 0.3.0
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/esm/components/Edges/Anchor.d.ts +2 -2
- package/dist/esm/components/Edges/Anchor.d.ts.map +1 -1
- package/dist/esm/components/Edges/EdgeWrapper/index.d.ts.map +1 -1
- package/dist/esm/components/Edges/EdgeWrapper/type.d.ts +3 -1
- package/dist/esm/components/Edges/EdgeWrapper/type.d.ts.map +1 -1
- package/dist/esm/components/Port/utils.d.ts +9 -1
- package/dist/esm/components/Port/utils.d.ts.map +1 -1
- package/dist/esm/components/ReactDiagramProvider/type.d.ts +1 -0
- package/dist/esm/components/ReactDiagramProvider/type.d.ts.map +1 -1
- package/dist/esm/components/StoreUpdater/index.d.ts +2 -2
- package/dist/esm/components/StoreUpdater/index.d.ts.map +1 -1
- package/dist/esm/container/ConnectionLineRenderer/ConnectionPath.d.ts +17 -0
- package/dist/esm/container/ConnectionLineRenderer/ConnectionPath.d.ts.map +1 -0
- package/dist/esm/container/ConnectionLineRenderer/index.d.ts +11 -0
- package/dist/esm/container/ConnectionLineRenderer/index.d.ts.map +1 -0
- package/dist/esm/container/ConnectionLineRenderer/type.d.ts +15 -0
- package/dist/esm/container/ConnectionLineRenderer/type.d.ts.map +1 -0
- package/dist/esm/container/EdgeRenderer/index.d.ts +2 -2
- package/dist/esm/container/EdgeRenderer/index.d.ts.map +1 -1
- package/dist/esm/container/EdgeRenderer/type.d.ts +3 -3
- package/dist/esm/container/EdgeRenderer/type.d.ts.map +1 -1
- package/dist/esm/container/ReactDiagram/DiagramView.d.ts +1 -1
- package/dist/esm/container/ReactDiagram/DiagramView.d.ts.map +1 -1
- package/dist/esm/container/ReactDiagram/index.d.ts +4 -4
- package/dist/esm/index.js +83 -97
- package/dist/esm/store/initialState.d.ts.map +1 -1
- package/dist/esm/types/core.d.ts +5 -5
- package/dist/esm/types/core.d.ts.map +1 -1
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/style.css +12 -6
- package/dist/umd/components/Edges/Anchor.d.ts +2 -2
- package/dist/umd/components/Edges/Anchor.d.ts.map +1 -1
- package/dist/umd/components/Edges/EdgeWrapper/index.d.ts.map +1 -1
- package/dist/umd/components/Edges/EdgeWrapper/type.d.ts +3 -1
- package/dist/umd/components/Edges/EdgeWrapper/type.d.ts.map +1 -1
- package/dist/umd/components/Port/utils.d.ts +9 -1
- package/dist/umd/components/Port/utils.d.ts.map +1 -1
- package/dist/umd/components/ReactDiagramProvider/type.d.ts +1 -0
- package/dist/umd/components/ReactDiagramProvider/type.d.ts.map +1 -1
- package/dist/umd/components/StoreUpdater/index.d.ts +2 -2
- package/dist/umd/components/StoreUpdater/index.d.ts.map +1 -1
- package/dist/umd/container/ConnectionLineRenderer/ConnectionPath.d.ts +17 -0
- package/dist/umd/container/ConnectionLineRenderer/ConnectionPath.d.ts.map +1 -0
- package/dist/umd/container/ConnectionLineRenderer/index.d.ts +11 -0
- package/dist/umd/container/ConnectionLineRenderer/index.d.ts.map +1 -0
- package/dist/umd/container/ConnectionLineRenderer/type.d.ts +15 -0
- package/dist/umd/container/ConnectionLineRenderer/type.d.ts.map +1 -0
- package/dist/umd/container/EdgeRenderer/index.d.ts +2 -2
- package/dist/umd/container/EdgeRenderer/index.d.ts.map +1 -1
- package/dist/umd/container/EdgeRenderer/type.d.ts +3 -3
- package/dist/umd/container/EdgeRenderer/type.d.ts.map +1 -1
- package/dist/umd/container/ReactDiagram/DiagramView.d.ts +1 -1
- package/dist/umd/container/ReactDiagram/DiagramView.d.ts.map +1 -1
- package/dist/umd/container/ReactDiagram/index.d.ts +4 -4
- package/dist/umd/index.js +2 -2
- package/dist/umd/store/initialState.d.ts.map +1 -1
- package/dist/umd/types/core.d.ts +5 -5
- package/dist/umd/types/core.d.ts.map +1 -1
- package/dist/umd/types/index.d.ts +1 -1
- package/dist/umd/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/esm/components/ConnectionEdge/ConnectionPath.d.ts +0 -16
- package/dist/esm/components/ConnectionEdge/ConnectionPath.d.ts.map +0 -1
- package/dist/esm/components/ConnectionEdge/index.d.ts +0 -11
- package/dist/esm/components/ConnectionEdge/index.d.ts.map +0 -1
- package/dist/esm/components/ConnectionEdge/type.d.ts +0 -22
- package/dist/esm/components/ConnectionEdge/type.d.ts.map +0 -1
- package/dist/umd/components/ConnectionEdge/ConnectionPath.d.ts +0 -16
- package/dist/umd/components/ConnectionEdge/ConnectionPath.d.ts.map +0 -1
- package/dist/umd/components/ConnectionEdge/index.d.ts +0 -11
- package/dist/umd/components/ConnectionEdge/index.d.ts.map +0 -1
- package/dist/umd/components/ConnectionEdge/type.d.ts +0 -22
- package/dist/umd/components/ConnectionEdge/type.d.ts.map +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -381,7 +381,7 @@ const getMarkerId = (marker, rfId) => {
|
|
|
381
381
|
.map((key) => `${key}=${marker[key]}`)
|
|
382
382
|
.join('&')}`;
|
|
383
383
|
};
|
|
384
|
-
const getEdgeId = ({ source, target }) => `
|
|
384
|
+
const getEdgeId = ({ source, target }) => `react-diagram__edge-${source}-${target}`;
|
|
385
385
|
const isExistsConnection = (edge, edges) => edges.some((el) => el.source === edge.source && el.target === edge.target);
|
|
386
386
|
const addEdge = (edgeParams, edges) => {
|
|
387
387
|
if (!isEdge(edgeParams)) {
|
|
@@ -737,13 +737,6 @@ var MarkerType;
|
|
|
737
737
|
MarkerType["Arrow"] = "arrow";
|
|
738
738
|
})(MarkerType || (MarkerType = {}));
|
|
739
739
|
|
|
740
|
-
var ConnectionEdgeType;
|
|
741
|
-
(function (ConnectionEdgeType) {
|
|
742
|
-
ConnectionEdgeType["Straight"] = "straight";
|
|
743
|
-
ConnectionEdgeType["Bezier"] = "bezier";
|
|
744
|
-
ConnectionEdgeType["Step"] = "step";
|
|
745
|
-
})(ConnectionEdgeType || (ConnectionEdgeType = {}));
|
|
746
|
-
|
|
747
740
|
const selector$3 = (s) => ({
|
|
748
741
|
nodesDraggable: s.nodesDraggable,
|
|
749
742
|
elementsSelectable: s.elementsSelectable,
|
|
@@ -1227,9 +1220,22 @@ const getClosestPort = (pos, connectionRadius, ports) => {
|
|
|
1227
1220
|
});
|
|
1228
1221
|
return closestPort;
|
|
1229
1222
|
};
|
|
1223
|
+
const pointToRendererPoint = ({ x, y }, [tx, ty, tScale]) => {
|
|
1224
|
+
const position = {
|
|
1225
|
+
x: (x - tx) / tScale,
|
|
1226
|
+
y: (y - ty) / tScale,
|
|
1227
|
+
};
|
|
1228
|
+
return position;
|
|
1229
|
+
};
|
|
1230
|
+
const rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => {
|
|
1231
|
+
return {
|
|
1232
|
+
x: x * tScale + tx,
|
|
1233
|
+
y: y * tScale + ty,
|
|
1234
|
+
};
|
|
1235
|
+
};
|
|
1230
1236
|
const handlePointerDown = ({ isAnchor = false, event, nodeId, portType, getState, setState, onConnect, onEdgeUpdateEnd, }) => {
|
|
1231
1237
|
const doc = getHostForElement(event.target);
|
|
1232
|
-
const { domNode, autoPanOnConnect, getNodes, cancelConnection, onConnectStart, onConnectEnd, panBy, } = getState();
|
|
1238
|
+
const { domNode, autoPanOnConnect, connectionRadius, getNodes, cancelConnection, onConnectStart, onConnectEnd, panBy, } = getState();
|
|
1233
1239
|
const containerBounds = domNode?.getBoundingClientRect();
|
|
1234
1240
|
const { x, y } = getEventPosition(event);
|
|
1235
1241
|
const clickedPort = doc?.elementFromPoint(x, y);
|
|
@@ -1263,8 +1269,9 @@ const handlePointerDown = ({ isAnchor = false, event, nodeId, portType, getState
|
|
|
1263
1269
|
});
|
|
1264
1270
|
onConnectStart?.(event, { nodeId, portType });
|
|
1265
1271
|
const onPointerMove = (event) => {
|
|
1272
|
+
const { transform } = getState();
|
|
1266
1273
|
connectionPosition = getEventPosition(event, containerBounds);
|
|
1267
|
-
closestPort = getClosestPort(connectionPosition,
|
|
1274
|
+
closestPort = getClosestPort(pointToRendererPoint(connectionPosition, transform), connectionRadius, allPort);
|
|
1268
1275
|
if (!autoPanStarted) {
|
|
1269
1276
|
autoPan();
|
|
1270
1277
|
autoPanStarted = true;
|
|
@@ -1272,20 +1279,11 @@ const handlePointerDown = ({ isAnchor = false, event, nodeId, portType, getState
|
|
|
1272
1279
|
const result = getConnection(event, closestPort, nodeId, portType, doc);
|
|
1273
1280
|
isValid = result.isValid;
|
|
1274
1281
|
connection = result.connection;
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
y,
|
|
1281
|
-
},
|
|
1282
|
-
});
|
|
1283
|
-
}
|
|
1284
|
-
else {
|
|
1285
|
-
setState({
|
|
1286
|
-
connectionPosition,
|
|
1287
|
-
});
|
|
1288
|
-
}
|
|
1282
|
+
setState({
|
|
1283
|
+
connectionPosition: closestPort && isValid
|
|
1284
|
+
? rendererPointToPoint(closestPort, transform)
|
|
1285
|
+
: connectionPosition,
|
|
1286
|
+
});
|
|
1289
1287
|
};
|
|
1290
1288
|
const onPointerUp = (event) => {
|
|
1291
1289
|
if (isValid && connection)
|
|
@@ -1324,12 +1322,15 @@ const portPositionY = (y, shift, position) => {
|
|
|
1324
1322
|
return y + shift;
|
|
1325
1323
|
return y;
|
|
1326
1324
|
};
|
|
1327
|
-
const EdgeUpdaterClassName = 'react-
|
|
1328
|
-
function Anchor({ position, centerX, centerY, radius = 10, onMouseDown,
|
|
1325
|
+
const EdgeUpdaterClassName = 'react-diagram__edge-updater';
|
|
1326
|
+
function Anchor({ position, centerX, centerY, radius = 10, onMouseDown,
|
|
1327
|
+
// onMouseEnter,
|
|
1328
|
+
// onMouseOut,
|
|
1329
|
+
type, }) {
|
|
1329
1330
|
return (jsx("circle", { className: cc([
|
|
1330
1331
|
EdgeUpdaterClassName,
|
|
1331
1332
|
`${EdgeUpdaterClassName}-${type}`,
|
|
1332
|
-
]), cx: portPositionX(centerX, radius, position), cy: portPositionY(centerY, radius, position), r: radius, stroke: "transparent", fill: "transparent", onMouseDown: onMouseDown
|
|
1333
|
+
]), cx: portPositionX(centerX, radius, position), cy: portPositionY(centerY, radius, position), r: radius, stroke: "transparent", fill: "transparent", onMouseDown: onMouseDown }));
|
|
1333
1334
|
}
|
|
1334
1335
|
|
|
1335
1336
|
function getMouseHandler$1(id, getState, handler) {
|
|
@@ -1351,11 +1352,34 @@ const wrapEdge = (EdgeComponent) => {
|
|
|
1351
1352
|
markerEnd, markerStart,
|
|
1352
1353
|
// labelProps
|
|
1353
1354
|
label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius,
|
|
1355
|
+
// AnchorProps
|
|
1356
|
+
edgeUpdaterRadius,
|
|
1354
1357
|
// position
|
|
1355
1358
|
sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, selected, elementsSelectable, hidden, isFocusable, onClick, onDoubleClick, onContextMenu, onMouseEnter, onMouseMove, onMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd, } = props;
|
|
1359
|
+
const position = {
|
|
1360
|
+
sourceX,
|
|
1361
|
+
sourceY,
|
|
1362
|
+
targetX,
|
|
1363
|
+
targetY,
|
|
1364
|
+
sourcePosition,
|
|
1365
|
+
targetPosition,
|
|
1366
|
+
};
|
|
1367
|
+
const sourceAndTargetIds = {
|
|
1368
|
+
source,
|
|
1369
|
+
sourcePort,
|
|
1370
|
+
target,
|
|
1371
|
+
targetPort,
|
|
1372
|
+
};
|
|
1373
|
+
const isConnecting = className === 'react-diagram__connection';
|
|
1374
|
+
if (isConnecting) {
|
|
1375
|
+
document
|
|
1376
|
+
.querySelector('path')
|
|
1377
|
+
?.classList.add('react-diagram__connection-path');
|
|
1378
|
+
return (jsx(EdgeComponent, { ...sourceAndTargetIds, ...position, id: id, data: data, style: style, selected: selected }));
|
|
1379
|
+
}
|
|
1380
|
+
const store = useStoreApi();
|
|
1356
1381
|
const edgeRef = useRef(null);
|
|
1357
1382
|
const [updating, setUpdating] = useState(false);
|
|
1358
|
-
const store = useStoreApi();
|
|
1359
1383
|
const markerStartUrl = useMemo(() => `url(#${getMarkerId(markerStart, rfId)})`, [markerStart, rfId]);
|
|
1360
1384
|
const markerEndUrl = useMemo(() => `url(#${getMarkerId(markerEnd, rfId)})`, [markerEnd, rfId]);
|
|
1361
1385
|
if (hidden) {
|
|
@@ -1406,12 +1430,6 @@ const wrapEdge = (EdgeComponent) => {
|
|
|
1406
1430
|
{ selected, inactive },
|
|
1407
1431
|
]);
|
|
1408
1432
|
const marker = { markerStart: markerStartUrl, markerEnd: markerEndUrl };
|
|
1409
|
-
const sourceAndTargetIds = {
|
|
1410
|
-
source,
|
|
1411
|
-
sourcePort,
|
|
1412
|
-
target,
|
|
1413
|
-
targetPort,
|
|
1414
|
-
};
|
|
1415
1433
|
const labelProps = {
|
|
1416
1434
|
label,
|
|
1417
1435
|
labelStyle,
|
|
@@ -1420,14 +1438,6 @@ const wrapEdge = (EdgeComponent) => {
|
|
|
1420
1438
|
labelBgPadding,
|
|
1421
1439
|
labelBgBorderRadius,
|
|
1422
1440
|
};
|
|
1423
|
-
const position = {
|
|
1424
|
-
sourceX,
|
|
1425
|
-
sourceY,
|
|
1426
|
-
targetX,
|
|
1427
|
-
targetY,
|
|
1428
|
-
sourcePosition,
|
|
1429
|
-
targetPosition,
|
|
1430
|
-
};
|
|
1431
1441
|
const events = {
|
|
1432
1442
|
onClick: onEdgeClick,
|
|
1433
1443
|
onDoubleClick: onEdgeDoubleClick,
|
|
@@ -1436,11 +1446,17 @@ const wrapEdge = (EdgeComponent) => {
|
|
|
1436
1446
|
onMouseMove: onEdgeMouseMove,
|
|
1437
1447
|
onMouseLeave: onEdgeMouseLeave,
|
|
1438
1448
|
};
|
|
1439
|
-
return (
|
|
1449
|
+
return (jsx("g", { ...events, ref: edgeRef, className: wrapperClassName, tabIndex: isFocusable ? 0 : undefined, role: isFocusable ? 'button' : undefined, "aria-label": ariaLabel === null
|
|
1440
1450
|
? undefined
|
|
1441
1451
|
: ariaLabel
|
|
1442
1452
|
? ariaLabel
|
|
1443
|
-
: `Edge from ${source} to ${target}`, "aria-describedby": isFocusable ? `${ARIA_EDGE_DESC_KEY}-${rfId}` : undefined, children:
|
|
1453
|
+
: `Edge from ${source} to ${target}`, "aria-describedby": isFocusable ? `${ARIA_EDGE_DESC_KEY}-${rfId}` : undefined, children: !updating && (jsxs(Fragment, { children: [jsx(EdgeComponent, { ...sourceAndTargetIds, ...marker, ...labelProps, ...position, id: id, data: data, style: style, selected: selected }), jsx(Anchor, { position: sourcePosition, centerX: sourceX, centerY: sourceY, radius: edgeUpdaterRadius, onMouseDown: handleEdgeUpdater('target'),
|
|
1454
|
+
// onMouseEnter={console.log}
|
|
1455
|
+
// onMouseOut={console.log}
|
|
1456
|
+
type: "source" }), jsx(Anchor, { position: targetPosition, centerX: targetX, centerY: targetY, radius: edgeUpdaterRadius, onMouseDown: handleEdgeUpdater('source'),
|
|
1457
|
+
// onMouseEnter={console.log}
|
|
1458
|
+
// onMouseOut={console.log}
|
|
1459
|
+
type: "target" })] })) }));
|
|
1444
1460
|
};
|
|
1445
1461
|
EdgeWrapper.displayName = 'EdgeWrapper';
|
|
1446
1462
|
return memo(EdgeWrapper);
|
|
@@ -1540,7 +1556,7 @@ const selector$2 = (s) => ({
|
|
|
1540
1556
|
nodeInternals: s.nodeInternals,
|
|
1541
1557
|
onError: s.onError,
|
|
1542
1558
|
});
|
|
1543
|
-
function EdgeRenderer({ rfId, edgeTypes, noPanClassName, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd, }) {
|
|
1559
|
+
function EdgeRenderer({ rfId, edgeTypes, noPanClassName, edgeUpdaterRadius, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd, }) {
|
|
1544
1560
|
const { edges, width, height, nodeInternals } = useStore(selector$2, shallow);
|
|
1545
1561
|
return (jsxs("svg", { width: width || '100vw', height: height || '100vh', className: "react-diagram__edges react-diagram__container", children: [jsx(MarkerComponent$1, { defaultColor: "#000000", rfId: rfId }), jsx("g", { children: edges.map((edge) => {
|
|
1546
1562
|
const { data, type,
|
|
@@ -1609,7 +1625,7 @@ function EdgeRenderer({ rfId, edgeTypes, noPanClassName, onEdgeClick, onEdgeDoub
|
|
|
1609
1625
|
onEdgeUpdateStart,
|
|
1610
1626
|
onEdgeUpdateEnd,
|
|
1611
1627
|
};
|
|
1612
|
-
return (jsx(EdgeComponent, { ...elProps, ...sourceAndTargetIds, ...marker, ...labelProps, ...position, ...events, rfId: rfId, type: edgeType, data: data, isFocusable: isFocusable }, id));
|
|
1628
|
+
return (jsx(EdgeComponent, { ...elProps, ...sourceAndTargetIds, ...marker, ...labelProps, ...position, ...events, rfId: rfId, type: edgeType, data: data, isFocusable: isFocusable, edgeUpdaterRadius: edgeUpdaterRadius }, id));
|
|
1613
1629
|
}) })] }));
|
|
1614
1630
|
}
|
|
1615
1631
|
EdgeRenderer.displayName = 'EdgeRenderer';
|
|
@@ -1621,7 +1637,7 @@ const oppositePosition = {
|
|
|
1621
1637
|
[Position.Top]: Position.Bottom,
|
|
1622
1638
|
[Position.Bottom]: Position.Top,
|
|
1623
1639
|
};
|
|
1624
|
-
function ConnectionPath({
|
|
1640
|
+
function ConnectionPath({ nodeId, portType, edge, Component, EdgeWrapper, }) {
|
|
1625
1641
|
const { fromNode, toX, toY } = useStore(useCallback((s) => ({
|
|
1626
1642
|
fromNode: s.nodeInternals.get(nodeId),
|
|
1627
1643
|
toX: (s.connectionPosition.x - s.transform[0]) / s.transform[2],
|
|
@@ -1647,30 +1663,9 @@ function ConnectionPath({ style, nodeId, portType, type = ConnectionEdgeType.Str
|
|
|
1647
1663
|
return null;
|
|
1648
1664
|
}
|
|
1649
1665
|
if (Component) {
|
|
1650
|
-
return (jsx(Component, {
|
|
1651
|
-
}
|
|
1652
|
-
let d = '';
|
|
1653
|
-
const pathParams = {
|
|
1654
|
-
sourceX: fromX,
|
|
1655
|
-
sourceY: fromY,
|
|
1656
|
-
sourcePosition: fromPosition,
|
|
1657
|
-
targetX: toX,
|
|
1658
|
-
targetY: toY,
|
|
1659
|
-
targetPosition: toPosition,
|
|
1660
|
-
};
|
|
1661
|
-
if (type === ConnectionEdgeType.Bezier) {
|
|
1662
|
-
[d] = getBezierPath(pathParams);
|
|
1663
|
-
}
|
|
1664
|
-
else if (type === ConnectionEdgeType.Step) {
|
|
1665
|
-
[d] = getStepPath({
|
|
1666
|
-
...pathParams,
|
|
1667
|
-
borderRadius: 0,
|
|
1668
|
-
});
|
|
1666
|
+
return (jsx(Component, { fromNode: fromNode, fromPort: fromPort, fromX: fromX, fromY: fromY, toX: toX, toY: toY, fromPosition: fromPosition, toPosition: toPosition }));
|
|
1669
1667
|
}
|
|
1670
|
-
|
|
1671
|
-
d = `M${fromX},${fromY} ${toX},${toY}`;
|
|
1672
|
-
}
|
|
1673
|
-
return (jsx("path", { d: d, fill: "none", className: "react-diagram__connection-path", style: style }));
|
|
1668
|
+
return (jsx(EdgeWrapper, { id: edge.id, className: "react-diagram__connection", type: edge.type || 'default', source: edge.source, target: edge.target, isFocusable: false, sourceX: fromX, sourceY: fromY, targetX: toX, targetY: toY, sourcePosition: fromPosition, targetPosition: toPosition }));
|
|
1674
1669
|
}
|
|
1675
1670
|
ConnectionPath.displayName = 'ConnectionPath';
|
|
1676
1671
|
|
|
@@ -1679,30 +1674,19 @@ const selector$1 = (s) => ({
|
|
|
1679
1674
|
nodeId: s.connectionNodeId,
|
|
1680
1675
|
portType: s.connectionPortType,
|
|
1681
1676
|
});
|
|
1682
|
-
function
|
|
1677
|
+
function ConnectionLineRenderer({ containerStyle, edgeTypes, component, }) {
|
|
1683
1678
|
const { nodeId, portType, edges } = useStore(selector$1, shallow);
|
|
1684
1679
|
const isValid = !!(nodeId && portType);
|
|
1685
1680
|
if (!isValid) {
|
|
1686
1681
|
return null;
|
|
1687
1682
|
}
|
|
1688
|
-
const
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
connectionEdgeType = edgeType;
|
|
1696
|
-
}
|
|
1697
|
-
else {
|
|
1698
|
-
connectionEdgeType = 'straight';
|
|
1699
|
-
}
|
|
1700
|
-
return connectionEdgeType;
|
|
1701
|
-
};
|
|
1702
|
-
const currentEdgeType = edges.find((edge) => edge[portType] === nodeId)
|
|
1703
|
-
?.type;
|
|
1704
|
-
const edgeType = getConnectionEdgeType(currentEdgeType);
|
|
1705
|
-
return (jsx("svg", { style: containerStyle, className: "react-diagram__container react-diagram__edges react-diagram__connection-line", children: jsx("g", { className: "react-diagram__connection", children: jsx(ConnectionPath, { style: style, nodeId: nodeId, portType: portType, type: edgeType, Component: component }) }) }));
|
|
1683
|
+
const selectedEdge = edges.find((edge) => edge[portType] === nodeId);
|
|
1684
|
+
if (!selectedEdge)
|
|
1685
|
+
return null;
|
|
1686
|
+
const EdgeWrapper = selectedEdge?.type
|
|
1687
|
+
? edgeTypes[selectedEdge.type]
|
|
1688
|
+
: edgeTypes.default;
|
|
1689
|
+
return (jsx("svg", { style: containerStyle, className: "react-diagram__container react-diagram__connection-line", children: jsx("g", { className: "react-diagram__connection", children: jsx(ConnectionPath, { nodeId: nodeId, portType: portType, edge: selectedEdge, Component: component, EdgeWrapper: EdgeWrapper }) }) }));
|
|
1706
1690
|
}
|
|
1707
1691
|
|
|
1708
1692
|
function DiagramView({ rfId,
|
|
@@ -1711,10 +1695,10 @@ noPanClassName, panning, defaultViewport, multiSelectionKeyCode, onMove, onMoveS
|
|
|
1711
1695
|
// NodeRenderer props
|
|
1712
1696
|
onlyRenderVisibleElements, disableKeyboardA11y, noDragClassName, nodeOrigin, nodeTypes, onNodeClick, onNodeDoubleClick, onNodeContextMenu, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave,
|
|
1713
1697
|
// EdgeRenderer props
|
|
1714
|
-
edgeTypes, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd,
|
|
1698
|
+
edgeTypes, edgeUpdaterRadius, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd,
|
|
1715
1699
|
// ConnectionLineWrapper
|
|
1716
|
-
|
|
1717
|
-
return (jsxs(DiagramRenderer$1, { multiSelectionKeyCode: multiSelectionKeyCode, noPanClassName: noPanClassName, panning: panning, defaultViewport: defaultViewport, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, children: [jsx(NodeRenderer$1, { rfId: rfId, nodeTypes: nodeTypes, onlyRenderVisibleElements: onlyRenderVisibleElements, disableKeyboardA11y: disableKeyboardA11y, nodeOrigin: nodeOrigin, noDragClassName: noDragClassName, noPanClassName: noPanClassName, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeContextMenu: onNodeContextMenu, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave }), jsx(EdgeRenderer$1, { rfId: rfId, edgeTypes: edgeTypes, noPanClassName: noPanClassName, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, onEdgeUpdate: onEdgeUpdate, onEdgeUpdateStart: onEdgeUpdateStart, onEdgeUpdateEnd: onEdgeUpdateEnd }), jsx(
|
|
1700
|
+
ConnectionLineContainerStyle, ConnectionLineComponent, }) {
|
|
1701
|
+
return (jsxs(DiagramRenderer$1, { multiSelectionKeyCode: multiSelectionKeyCode, noPanClassName: noPanClassName, panning: panning, defaultViewport: defaultViewport, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, children: [jsx(NodeRenderer$1, { rfId: rfId, nodeTypes: nodeTypes, onlyRenderVisibleElements: onlyRenderVisibleElements, disableKeyboardA11y: disableKeyboardA11y, nodeOrigin: nodeOrigin, noDragClassName: noDragClassName, noPanClassName: noPanClassName, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeContextMenu: onNodeContextMenu, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave }), jsx(EdgeRenderer$1, { rfId: rfId, edgeTypes: edgeTypes, noPanClassName: noPanClassName, edgeUpdaterRadius: edgeUpdaterRadius, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, onEdgeUpdate: onEdgeUpdate, onEdgeUpdateStart: onEdgeUpdateStart, onEdgeUpdateEnd: onEdgeUpdateEnd }), jsx(ConnectionLineRenderer, { edgeTypes: edgeTypes, containerStyle: ConnectionLineContainerStyle, component: ConnectionLineComponent })] }));
|
|
1718
1702
|
}
|
|
1719
1703
|
DiagramView.displayName = 'DiagramView';
|
|
1720
1704
|
var DiagramView$1 = memo(DiagramView);
|
|
@@ -1745,7 +1729,7 @@ function useDirectStoreUpdater(key, value, setState) {
|
|
|
1745
1729
|
}
|
|
1746
1730
|
}, [value]);
|
|
1747
1731
|
}
|
|
1748
|
-
const StoreUpdater = ({ nodes, onNodesChange, onNodeDrag, onNodeDragStart, onNodeDragEnd, edges, onEdgesChange, gridStep, elevateNodesOnSelect, nodesDraggable, autoPanOnNodeDrag, autoPanOnConnect, onConnect, onConnectStart, onConnectEnd, onError, nodeExtent, translateExtent, minZoom, maxZoom, }) => {
|
|
1732
|
+
const StoreUpdater = ({ nodes, onNodesChange, onNodeDrag, onNodeDragStart, onNodeDragEnd, edges, onEdgesChange, gridStep, elevateNodesOnSelect, nodesDraggable, autoPanOnNodeDrag, autoPanOnConnect, connectionRadius, onConnect, onConnectStart, onConnectEnd, onError, nodeExtent, translateExtent, minZoom, maxZoom, }) => {
|
|
1749
1733
|
const { setNodes, setEdges, setNodeExtent, setTranslateExtent, setMinZoom, setMaxZoom, } = useStore(selector, shallow);
|
|
1750
1734
|
const store = useStoreApi();
|
|
1751
1735
|
useDirectStoreUpdater('gridStep', gridStep, store.setState);
|
|
@@ -1759,6 +1743,7 @@ const StoreUpdater = ({ nodes, onNodesChange, onNodeDrag, onNodeDragStart, onNod
|
|
|
1759
1743
|
useDirectStoreUpdater('nodesDraggable', nodesDraggable, store.setState);
|
|
1760
1744
|
useDirectStoreUpdater('autoPanOnNodeDrag', autoPanOnNodeDrag, store.setState);
|
|
1761
1745
|
useDirectStoreUpdater('autoPanOnConnect', autoPanOnConnect, store.setState);
|
|
1746
|
+
useDirectStoreUpdater('connectionRadius', connectionRadius, store.setState);
|
|
1762
1747
|
useDirectStoreUpdater('onNodesChange', onNodesChange, store.setState);
|
|
1763
1748
|
useDirectStoreUpdater('onNodeDrag', onNodeDrag, store.setState);
|
|
1764
1749
|
useDirectStoreUpdater('onNodeDragStart', onNodeDragStart, store.setState);
|
|
@@ -2397,6 +2382,7 @@ const initialState = {
|
|
|
2397
2382
|
autoPanOnConnect: true,
|
|
2398
2383
|
nodeExtent: infiniteExtent,
|
|
2399
2384
|
translateExtent: infiniteExtent,
|
|
2385
|
+
connectionRadius: 20,
|
|
2400
2386
|
onError: devWarn,
|
|
2401
2387
|
};
|
|
2402
2388
|
|
|
@@ -2594,13 +2580,13 @@ const defaultEdgeTypes = {
|
|
|
2594
2580
|
};
|
|
2595
2581
|
const ReactDiagram = forwardRef(({ id,
|
|
2596
2582
|
// DiagramView props
|
|
2597
|
-
panning = true, minZoom, maxZoom, translateExtent, nodeExtent, defaultViewport = initViewport, multiSelectionKeyCode, onlyRenderVisibleElements = false, disableKeyboardA11y = false, noDragClassName = 'nodrag', noPanClassName = 'nopan', nodeOrigin = initNodeOrigin, nodeTypes = defaultNodeTypes, onNodeClick, onNodeDoubleClick, onNodeContextMenu, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, edgeTypes = defaultEdgeTypes, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd, onMove, onMoveStart, onMoveEnd,
|
|
2583
|
+
panning = true, minZoom, maxZoom, translateExtent, nodeExtent, defaultViewport = initViewport, multiSelectionKeyCode, onlyRenderVisibleElements = false, disableKeyboardA11y = false, noDragClassName = 'nodrag', noPanClassName = 'nopan', nodeOrigin = initNodeOrigin, nodeTypes = defaultNodeTypes, onNodeClick, onNodeDoubleClick, onNodeContextMenu, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, edgeTypes = defaultEdgeTypes, edgeUpdaterRadius, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd, onMove, onMoveStart, onMoveEnd, ConnectionLineContainerStyle, ConnectionLineComponent,
|
|
2598
2584
|
// StoreUpdater props
|
|
2599
|
-
nodes, edges, nodesDraggable, elevateNodesOnSelect, autoPanOnNodeDrag, autoPanOnConnect, onNodesChange, onNodeDrag, onNodeDragStart, onNodeDragEnd, onEdgesChange, onConnect, onConnectStart, onConnectEnd, onError, }, ref) => {
|
|
2585
|
+
nodes, edges, nodesDraggable, elevateNodesOnSelect, autoPanOnNodeDrag, autoPanOnConnect, connectionRadius, onNodesChange, onNodeDrag, onNodeDragStart, onNodeDragEnd, onEdgesChange, onConnect, onConnectStart, onConnectEnd, onError, }, ref) => {
|
|
2600
2586
|
const rfId = id || '1';
|
|
2601
2587
|
const nodeTypesWrapped = useNodeOrEdgeTypes(nodeTypes, createNodeTypes);
|
|
2602
2588
|
const edgeTypesWrapped = useNodeOrEdgeTypes(edgeTypes, createEdgeTypes);
|
|
2603
|
-
return (jsx("div", { ref: ref, className: "react-diagram", children: jsxs(Wrapper, { children: [jsx(DiagramView$1, { rfId: rfId, panning: panning, defaultViewport: defaultViewport, multiSelectionKeyCode: multiSelectionKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, disableKeyboardA11y: disableKeyboardA11y, noDragClassName: noDragClassName, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, nodeTypes: nodeTypesWrapped, edgeTypes: edgeTypesWrapped,
|
|
2589
|
+
return (jsx("div", { ref: ref, className: "react-diagram", children: jsxs(Wrapper, { children: [jsx(DiagramView$1, { rfId: rfId, panning: panning, defaultViewport: defaultViewport, multiSelectionKeyCode: multiSelectionKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, disableKeyboardA11y: disableKeyboardA11y, noDragClassName: noDragClassName, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, nodeTypes: nodeTypesWrapped, edgeTypes: edgeTypesWrapped, edgeUpdaterRadius: edgeUpdaterRadius, ConnectionLineContainerStyle: ConnectionLineContainerStyle, ConnectionLineComponent: ConnectionLineComponent, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeContextMenu: onNodeContextMenu, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, onEdgeUpdate: onEdgeUpdate, onEdgeUpdateStart: onEdgeUpdateStart, onEdgeUpdateEnd: onEdgeUpdateEnd, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd }), jsx(StoreUpdater, { rfId: rfId, nodes: nodes, edges: edges, nodesDraggable: nodesDraggable, elevateNodesOnSelect: elevateNodesOnSelect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanOnConnect: autoPanOnConnect, connectionRadius: connectionRadius, nodeExtent: nodeExtent, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, onNodesChange: onNodesChange, onNodeDrag: onNodeDrag, onNodeDragStart: onNodeDragStart, onNodeDragEnd: onNodeDragEnd, onEdgesChange: onEdgesChange, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onError: onError })] }) }));
|
|
2604
2590
|
});
|
|
2605
2591
|
ReactDiagram.displayName = 'ReactDiagram';
|
|
2606
2592
|
|
|
@@ -2614,4 +2600,4 @@ function createUseItemsState(applyChanges) {
|
|
|
2614
2600
|
const useNodesState = createUseItemsState(applyNodeChanges);
|
|
2615
2601
|
const useEdgesState = createUseItemsState(applyEdgeChanges);
|
|
2616
2602
|
|
|
2617
|
-
export { BaseEdge, BezierEdge,
|
|
2603
|
+
export { BaseEdge, BezierEdge, MarkerType, Port$1 as Port, Position, ReactDiagramProvider, StepEdge, addEdge, boxToRect, clamp, ReactDiagram as default, getBezierPath, getStepPath, internalsSymbol, isEdge, isNode, rectToBox, updateEdge, useEdgesState, useNodesState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialState.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/store/initialState.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,eAAO,MAAM,cAAc,EAAE,gBAG5B,CAAC;AAEF,QAAA,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"initialState.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/store/initialState.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,eAAO,MAAM,cAAc,EAAE,gBAG5B,CAAC;AAEF,QAAA,MAAM,YAAY,EAAE,iBAmCnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/dist/esm/types/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties, HTMLAttributes, MouseEvent as ReactMouseEvent } from 'react';
|
|
2
|
-
import { CoordinateExtent, GridStep, Viewport, Node, Edge, OnNodesChange, OnEdgesChange, OnConnect, OnConnectStart, OnConnectEnd, OnMove, OnError,
|
|
2
|
+
import { CoordinateExtent, GridStep, Viewport, Node, Edge, OnNodesChange, OnEdgesChange, OnConnect, OnConnectStart, OnConnectEnd, OnMove, OnError, ConnectionLineComponent } from '.';
|
|
3
3
|
import { NodeDragHandler } from '../hooks/useDrag/type';
|
|
4
4
|
import { KeyCode } from '../hooks/useGlobalKeyHandler';
|
|
5
5
|
import { NodeOrigin } from '../components/Node/utils';
|
|
@@ -19,10 +19,10 @@ export type ReactDiagramProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
19
19
|
nodeTypes?: NodeTypes;
|
|
20
20
|
edges?: Edge[];
|
|
21
21
|
edgeTypes?: EdgeTypes;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
edgeUpdaterRadius?: number;
|
|
23
|
+
ConnectionLineContainerStyle?: CSSProperties;
|
|
24
|
+
ConnectionLineComponent?: ConnectionLineComponent;
|
|
25
|
+
connectionRadius?: number;
|
|
26
26
|
onNodesChange?: OnNodesChange;
|
|
27
27
|
onNodeClick?: NodeMouseHandler;
|
|
28
28
|
onNodeDoubleClick?: NodeMouseHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/types/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACT,aAAa,EACb,cAAc,EACd,UAAU,IAAI,eAAe,EAC/B,MAAM,OAAO,CAAC;AAEf,OAAO,EACJ,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,aAAa,EACb,SAAS,EACT,cAAc,EACd,YAAY,EACZ,MAAM,EACN,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/types/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACT,aAAa,EACb,cAAc,EACd,UAAU,IAAI,eAAe,EAC/B,MAAM,OAAO,CAAC;AAEf,OAAO,EACJ,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,aAAa,EACb,SAAS,EACT,cAAc,EACd,YAAY,EACZ,MAAM,EACN,OAAO,EACP,uBAAuB,EACzB,MAAM,GAAG,CAAC;AAEX,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EACJ,gBAAgB,EAChB,gBAAgB,EAClB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC9D,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,mBAA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,CAAC,EAAE,gBAAgB,CAAC;IAChC,iBAAiB,CAAC,EAAE,CACjB,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,KAChB,IAAI,CAAC;IACV,eAAe,CAAC,EAAE,CACf,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,KAChB,IAAI,CAAC;IAEV,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,eAAe,CAAC,EAAE,gBAAgB,CAAC;IAEnC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC"}
|
|
@@ -4,5 +4,5 @@ export * from './core';
|
|
|
4
4
|
export * from '../hooks/useNodesEdgesState/type';
|
|
5
5
|
export * from '../components/Node/type';
|
|
6
6
|
export * from '../components/Edges/type';
|
|
7
|
-
export * from '../
|
|
7
|
+
export * from '../container/ConnectionLineRenderer/type';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AAEvB,cAAc,kCAAkC,CAAC;AAGjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AAEvB,cAAc,kCAAkC,CAAC;AAGjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0CAA0C,CAAC"}
|
package/dist/style.css
CHANGED
|
@@ -125,11 +125,6 @@
|
|
|
125
125
|
fill: none;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
.react-diagram__edgeupdater {
|
|
129
|
-
cursor: move;
|
|
130
|
-
pointer-events: all;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
128
|
.react-diagram__edge-text-bg {
|
|
134
129
|
fill: white;
|
|
135
130
|
}
|
|
@@ -149,6 +144,16 @@
|
|
|
149
144
|
font-size: 10px;
|
|
150
145
|
}
|
|
151
146
|
|
|
147
|
+
.react-diagram__edge-updater {
|
|
148
|
+
cursor: move;
|
|
149
|
+
pointer-events: all;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.react-diagram__edge-updater:hover {
|
|
153
|
+
transition: 0.2s;
|
|
154
|
+
fill: #000000;
|
|
155
|
+
}
|
|
156
|
+
|
|
152
157
|
.react-diagram__viewport {
|
|
153
158
|
transform-origin: 0 0;
|
|
154
159
|
z-index: 2;
|
|
@@ -160,7 +165,8 @@
|
|
|
160
165
|
cursor: grab;
|
|
161
166
|
}
|
|
162
167
|
|
|
163
|
-
.react-diagram .react-diagram__edges
|
|
168
|
+
.react-diagram .react-diagram__edges,
|
|
169
|
+
.react-diagram .react-diagram__connection-line {
|
|
164
170
|
pointer-events: none;
|
|
165
171
|
overflow: visible;
|
|
166
172
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MouseEvent as ReactMouseEvent, SVGAttributes } from 'react';
|
|
2
2
|
import { Position } from '../../types';
|
|
3
|
-
type EventNames = 'onMouseDown'
|
|
3
|
+
type EventNames = 'onMouseDown';
|
|
4
4
|
type AnchorEvents = {
|
|
5
5
|
[H in EventNames]?: (event: ReactMouseEvent<SVGGElement, MouseEvent>) => void;
|
|
6
6
|
};
|
|
@@ -11,6 +11,6 @@ interface AnchorProps extends SVGAttributes<SVGGElement>, AnchorEvents {
|
|
|
11
11
|
radius?: number;
|
|
12
12
|
type: string;
|
|
13
13
|
}
|
|
14
|
-
declare function Anchor({ position, centerX, centerY, radius, onMouseDown,
|
|
14
|
+
declare function Anchor({ position, centerX, centerY, radius, onMouseDown, type, }: AnchorProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export default Anchor;
|
|
16
16
|
//# sourceMappingURL=Anchor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Anchor.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/components/Edges/Anchor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,KAAK,UAAU,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"Anchor.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/components/Edges/Anchor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;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C,uBAOvD;AAED,QAAA,MAAM,QAAQ,kBAAmB,cAAc,SAAS,CAAC;YAC1B,aAAa,GAAG,WAAW,GAAG,IAAI;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../react-diagram/packages/src/components/Edges/EdgeWrapper/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAKpE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,wBAAgB,eAAe,CAC5B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAC,EACjD,OAAO,CAAC,EAAE,CACP,KAAK,EAAE,eAAe,CAAC,WAAW,EAAE,UAAU,CAAC,EAC/C,IAAI,EAAE,IAAI,KACR,IAAI,YAII,gBAAgB,WAAW,EAAE,UAAU,CAAC,uBAOvD;AAED,QAAA,MAAM,QAAQ,kBAAmB,cAAc,SAAS,CAAC;YAC1B,aAAa,GAAG,WAAW,GAAG,IAAI;;EA6QhE,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MouseEvent as ReactMouseEvent } from 'react';
|
|
1
|
+
import { ComponentType, MemoExoticComponent, MouseEvent as ReactMouseEvent } from 'react';
|
|
2
2
|
import { Position, Connection } from '../../../types';
|
|
3
3
|
import { PortType } from '../../Port/type';
|
|
4
4
|
import { Edge } from '../type';
|
|
@@ -14,6 +14,7 @@ export type WrapEdgeProps<T = any> = Edge<T> & {
|
|
|
14
14
|
elementsSelectable?: boolean;
|
|
15
15
|
rfId?: string;
|
|
16
16
|
isFocusable: boolean;
|
|
17
|
+
edgeUpdaterRadius?: number;
|
|
17
18
|
onClick?: EdgeMouseHandler;
|
|
18
19
|
onDoubleClick?: EdgeMouseHandler;
|
|
19
20
|
onContextMenu?: EdgeMouseHandler;
|
|
@@ -24,4 +25,5 @@ export type WrapEdgeProps<T = any> = Edge<T> & {
|
|
|
24
25
|
onEdgeUpdateStart?: (event: ReactMouseEvent, edge: Edge, portType: PortType) => void;
|
|
25
26
|
onEdgeUpdateEnd?: (event: MouseEvent | TouchEvent, edge: Edge, portType: PortType) => void;
|
|
26
27
|
};
|
|
28
|
+
export type EdgeWrapperComponent = MemoExoticComponent<ComponentType<WrapEdgeProps>>;
|
|
27
29
|
//# sourceMappingURL=type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../react-diagram/packages/src/components/Edges/EdgeWrapper/type.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../react-diagram/packages/src/components/Edges/EdgeWrapper/type.ts"],"names":[],"mappings":"AAAA,OAAO,EACJ,aAAa,EACb,mBAAmB,EACnB,UAAU,IAAI,eAAe,EAC/B,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;AAE5E,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,GAAG,IAAI,CACrC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,EACnB,aAAa,EAAE,UAAU,KACvB,IAAI,CAAC;AAEV,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,QAAQ,CAAC;IACzB,cAAc,EAAE,QAAQ,CAAC;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IAErB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAEhC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,iBAAiB,CAAC,EAAE,CACjB,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,KAChB,IAAI,CAAC;IACV,eAAe,CAAC,EAAE,CACf,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,KAChB,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,CACnD,aAAa,CAAC,aAAa,CAAC,CAC9B,CAAC"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { MouseEvent as ReactMouseEvent, TouchEvent as ReactTouchEvent } from 'react';
|
|
2
2
|
import { StoreApi } from 'zustand';
|
|
3
|
-
import { OnConnect } from '../../types';
|
|
3
|
+
import { OnConnect, XYPosition } from '../../types';
|
|
4
4
|
import { ReactDiagramState } from '../ReactDiagramProvider/type';
|
|
5
5
|
import { PortType } from './type';
|
|
6
|
+
type ConnectionPort = {
|
|
7
|
+
type: PortType;
|
|
8
|
+
nodeId: string;
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
};
|
|
6
12
|
export declare const getHostForElement: (element: HTMLElement) => Document | ShadowRoot;
|
|
13
|
+
export declare const getClosestPort: (pos: XYPosition, connectionRadius: number, ports: ConnectionPort[]) => ConnectionPort | null;
|
|
7
14
|
export declare const handlePointerDown: ({ isAnchor, event, nodeId, portType, getState, setState, onConnect, onEdgeUpdateEnd, }: {
|
|
8
15
|
isAnchor?: boolean | undefined;
|
|
9
16
|
event: ReactMouseEvent | ReactTouchEvent;
|
|
@@ -14,4 +21,5 @@ export declare const handlePointerDown: ({ isAnchor, event, nodeId, portType, ge
|
|
|
14
21
|
onConnect: OnConnect;
|
|
15
22
|
onEdgeUpdateEnd?: ((evt: MouseEvent | TouchEvent) => void) | undefined;
|
|
16
23
|
}) => void;
|
|
24
|
+
export {};
|
|
17
25
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/components/Port/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACJ,UAAU,IAAI,eAAe,EAC7B,UAAU,IAAI,eAAe,EAC/B,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQnC,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/components/Port/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACJ,UAAU,IAAI,eAAe,EAC7B,UAAU,IAAI,eAAe,EAC/B,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQnC,OAAO,EAGJ,SAAS,EAET,UAAU,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAc,MAAM,QAAQ,CAAC;AAa9C,KAAK,cAAc,GAAG;IAEnB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,iBAAiB,YAClB,WAAW,KACpB,QAAQ,GAAG,UAC2D,CAAC;AA2G1E,eAAO,MAAM,cAAc,QACnB,UAAU,oBACG,MAAM,SACjB,cAAc,EAAE,KACvB,cAAc,GAAG,IAenB,CAAC;AAwBF,eAAO,MAAM,iBAAiB;;WAWpB,eAAe,GAAG,eAAe;YAChC,MAAM;cACJ,QAAQ;cACR,SAAS,iBAAiB,CAAC,CAAC,UAAU,CAAC;cACvC,SAAS,iBAAiB,CAAC,CAAC,UAAU,CAAC;eACtC,SAAS;6BACI,UAAU,GAAG,UAAU,KAAK,IAAI;MACvD,IAoHH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/components/ReactDiagramProvider/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,IAAI,CAAC;AAE5D,OAAO,EACJ,IAAI,EACJ,IAAI,EACJ,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACd,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EACJ,UAAU,EACV,aAAa,EACb,aAAa,EACf,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,UAA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C;IAChC,kBAAkB,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEpC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,OAAO,CAAC;IAE1B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,eAAe,EAAE,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/components/ReactDiagramProvider/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,IAAI,CAAC;AAE5D,OAAO,EACJ,IAAI,EACJ,IAAI,EACJ,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACd,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EACJ,UAAU,EACV,aAAa,EACb,aAAa,EACf,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,MAAM,mBAAmB,GAAG;IAC/B,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,IAAI,EAAE,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dgesChange' | 'gridStep' | 'elevateNodesOnSelect' | 'nodesDraggable' | 'autoPanOnNodeDrag' | 'autoPanOnConnect' | 'onConnect' | 'onConnectStart' | 'onConnectEnd' | 'onError' | 'nodeExtent' | 'translateExtent' | 'minZoom' | 'maxZoom'> & {
|
|
2
|
+
export type StoreUpdaterProps = Pick<ReactDiagramProps, 'nodes' | 'onNodesChange' | 'onNodeDrag' | 'onNodeDragStart' | 'onNodeDragEnd' | 'edges' | 'onEdgesChange' | 'gridStep' | 'elevateNodesOnSelect' | 'nodesDraggable' | 'autoPanOnNodeDrag' | 'autoPanOnConnect' | 'onConnect' | 'onConnectStart' | 'onConnectEnd' | 'connectionRadius' | 'onError' | 'nodeExtent' | 'translateExtent' | 'minZoom' | 'maxZoom'> & {
|
|
3
3
|
rfId: string;
|
|
4
4
|
};
|
|
5
|
-
declare const StoreUpdater: ({ nodes, onNodesChange, onNodeDrag, onNodeDragStart, onNodeDragEnd, edges, onEdgesChange, gridStep, elevateNodesOnSelect, nodesDraggable, autoPanOnNodeDrag, autoPanOnConnect, onConnect, onConnectStart, onConnectEnd, onError, nodeExtent, translateExtent, minZoom, maxZoom, }: StoreUpdaterProps) => null;
|
|
5
|
+
declare const StoreUpdater: ({ nodes, onNodesChange, onNodeDrag, onNodeDragStart, onNodeDragEnd, edges, onEdgesChange, gridStep, elevateNodesOnSelect, nodesDraggable, autoPanOnNodeDrag, autoPanOnConnect, connectionRadius, onConnect, onConnectStart, onConnectEnd, onError, nodeExtent, translateExtent, minZoom, maxZoom, }: StoreUpdaterProps) => null;
|
|
6
6
|
export default StoreUpdater;
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/components/StoreUpdater/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAoB,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAQlE,MAAM,MAAM,iBAAiB,GAAG,IAAI,CACjC,iBAAiB,EACf,OAAO,GACP,eAAe,GACf,YAAY,GACZ,iBAAiB,GACjB,eAAe,GACf,OAAO,GACP,eAAe,GACf,UAAU,GACV,sBAAsB,GACtB,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,WAAW,GACX,gBAAgB,GAChB,cAAc,GACd,SAAS,GACT,YAAY,GACZ,iBAAiB,GACjB,SAAS,GACT,SAAS,CACb,GAAG;IACD,IAAI,EAAE,MAAM,CAAC;CACf,CAAC;AA6CF,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/components/StoreUpdater/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAoB,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAQlE,MAAM,MAAM,iBAAiB,GAAG,IAAI,CACjC,iBAAiB,EACf,OAAO,GACP,eAAe,GACf,YAAY,GACZ,iBAAiB,GACjB,eAAe,GACf,OAAO,GACP,eAAe,GACf,UAAU,GACV,sBAAsB,GACtB,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,WAAW,GACX,gBAAgB,GAChB,cAAc,GACd,kBAAkB,GAClB,SAAS,GACT,YAAY,GACZ,iBAAiB,GACjB,SAAS,GACT,SAAS,CACb,GAAG;IACD,IAAI,EAAE,MAAM,CAAC;CACf,CAAC;AA6CF,QAAA,MAAM,YAAY,wSAsBf,iBAAiB,SAiDnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Edge } from '../../types';
|
|
2
|
+
import { PortType } from '../../components/Port/type';
|
|
3
|
+
import { EdgeWrapperComponent } from '../../components/Edges/EdgeWrapper/type';
|
|
4
|
+
import { ConnectionLineComponent } from './type';
|
|
5
|
+
type ConnectionPathProps = {
|
|
6
|
+
nodeId: string;
|
|
7
|
+
portType: PortType;
|
|
8
|
+
edge: Edge;
|
|
9
|
+
Component?: ConnectionLineComponent;
|
|
10
|
+
EdgeWrapper: EdgeWrapperComponent;
|
|
11
|
+
};
|
|
12
|
+
declare function ConnectionPath({ nodeId, portType, edge, Component, EdgeWrapper, }: ConnectionPathProps): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
declare namespace ConnectionPath {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
export default ConnectionPath;
|
|
17
|
+
//# sourceMappingURL=ConnectionPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionPath.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/container/ConnectionLineRenderer/ConnectionPath.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,IAAI,EAAY,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AAEjD,KAAK,mBAAmB,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,oBAAoB,CAAC;CACpC,CAAC;AASF,iBAAS,cAAc,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,WAAW,GACb,EAAE,mBAAmB,kDAoErB;kBA1EQ,cAAc;;;AA8EvB,eAAe,cAAc,CAAC"}
|