@rxflow/base
Version:
BaseFlow - 核心 Flow 组件库
37 lines • 1.14 kB
JavaScript
/**
* @author: yanxianliang
* @date: 2025-07-23 15:02
* @modified:2025/7/23 15:02 by yanxianliang
* @desc: inner mark 定义
*
*
* 可以放到 workflow内部,自定义,不需要再遍历进行更新
*
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
*/
import { getMarkerId, MarkerType } from '@xyflow/system';
import { useFlowId } from "../..";
import "./styles.less";
import cls from 'classcat';
import { Marker } from "./Mark";
import { jsx as _jsx } from "react/jsx-runtime";
export var MarkerDefinitions = function MarkerDefinitions(_ref) {
var marks = _ref.marks;
var flowId = useFlowId();
return /*#__PURE__*/_jsx("svg", {
className: cls(["react-flow__marker", 'rxflow-marks']),
"aria-hidden": "true",
children: /*#__PURE__*/_jsx("defs", {
children: marks.map(function (mark, index) {
return /*#__PURE__*/_jsx(Marker, {
id: getMarkerId(mark, flowId),
type: MarkerType.ArrowClosed,
color: mark.color,
width: mark.width,
height: mark.height,
strokeWidth: mark.strokeWidth
}, index);
})
})
});
};