diff --git a/.changeset/plenty-buckets-tan.md b/.changeset/plenty-buckets-tan.md new file mode 100644 index 00000000..8c88dd2e --- /dev/null +++ b/.changeset/plenty-buckets-tan.md @@ -0,0 +1,6 @@ +--- +'@xyflow/react': patch +'@xyflow/system': patch +--- + +Allow strings and enums for existing marker types diff --git a/packages/react/src/container/EdgeRenderer/MarkerSymbols.tsx b/packages/react/src/container/EdgeRenderer/MarkerSymbols.tsx index 974d009e..90ef1228 100644 --- a/packages/react/src/container/EdgeRenderer/MarkerSymbols.tsx +++ b/packages/react/src/container/EdgeRenderer/MarkerSymbols.tsx @@ -28,7 +28,7 @@ export const MarkerSymbols = { [MarkerType.ArrowClosed]: ArrowClosedSymbol, }; -export function useMarkerSymbol(type: MarkerType) { +export function useMarkerSymbol(type: MarkerType | `${MarkerType}`) { const store = useStoreApi(); const symbol = useMemo(() => { diff --git a/packages/system/src/types/edges.ts b/packages/system/src/types/edges.ts index 143e66dd..03001d75 100644 --- a/packages/system/src/types/edges.ts +++ b/packages/system/src/types/edges.ts @@ -90,7 +90,7 @@ export enum ConnectionLineType { * @public */ export type EdgeMarker = { - type: MarkerType; + type: MarkerType | `${MarkerType}`; color?: string; width?: number; height?: number;