feat(nodes-edges): add domAttributes

This commit is contained in:
moklick
2025-06-05 15:41:44 +02:00
parent 3e6bcf51e3
commit 09458f52ff
12 changed files with 56 additions and 19 deletions
@@ -199,7 +199,7 @@ export function EdgeWrapper<EdgeType extends Edge = Edge>({
onKeyDown={isFocusable ? onKeyDown : undefined}
tabIndex={isFocusable ? 0 : undefined}
role={edge.ariaRole ?? (isFocusable ? 'group' : 'img')}
aria-roledescription={edge.ariaRoleDescription || 'edge'}
aria-roledescription={edge.domAttributes?.['aria-roledescription'] || 'edge'}
data-id={id}
data-testid={`rf__edge-${id}`}
aria-label={
@@ -207,6 +207,7 @@ export function EdgeWrapper<EdgeType extends Edge = Edge>({
}
aria-describedby={isFocusable ? `${ARIA_EDGE_DESC_KEY}-${rfId}` : undefined}
ref={edgeRef}
{...edge.domAttributes}
>
{!reconnecting && (
<EdgeComponent
@@ -196,9 +196,10 @@ export function NodeWrapper<NodeType extends Node>({
onKeyDown={isFocusable ? onKeyDown : undefined}
tabIndex={isFocusable ? 0 : undefined}
role={node.ariaRole ?? (isFocusable ? 'group' : undefined)}
aria-roledescription={node.ariaRoleDescription || 'node'}
aria-roledescription={node.domAttributes?.['aria-roledescription'] || 'node'}
aria-describedby={disableKeyboardA11y ? undefined : `${ARIA_NODE_DESC_KEY}-${rfId}`}
aria-label={node.ariaLabel}
{...node.domAttributes}
>
<Provider value={id}>
<NodeComponent