chore: rename LabelConfig -> AriaLabelConfig, update dict names
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
Node,
|
||||
Edge,
|
||||
OnNodeDrag,
|
||||
LabelConfig,
|
||||
AriaLabelConfig,
|
||||
} from '@xyflow/react';
|
||||
|
||||
const onNodeDrag: OnNodeDrag = (_, node: Node, nodes: Node[]) => console.log('drag', node, nodes);
|
||||
@@ -44,17 +44,17 @@ const initialEdges: Edge[] = [
|
||||
{ id: 'e1-3', source: '1', target: '3' },
|
||||
];
|
||||
|
||||
const labelConfig: Partial<LabelConfig> = {
|
||||
'a11yDescription.node.default': 'Custom Node Desc.',
|
||||
'a11yDescription.node.keyboardDisabled': 'Custom Keyboard Desc.',
|
||||
'a11yDescription.edge.default': 'Custom Edge Desc.',
|
||||
const ariaLabelConfig: Partial<AriaLabelConfig> = {
|
||||
'node.a11yDescription.default': 'Custom Node Desc.',
|
||||
'node.a11yDescription.keyboardDisabled': 'Custom Keyboard Desc.',
|
||||
'edge.a11yDescription.default': 'Custom Edge Desc.',
|
||||
'a11yDescription.ariaLiveMessage': ({ direction, x, y }) =>
|
||||
`Custom Moved selected node ${direction}. New position, x: ${x}, y: ${y}`,
|
||||
'controls.ariaLabel': 'Custom Controls Aria Label',
|
||||
'controls.zoomin.title': 'Custom Zoom in',
|
||||
'controls.zoomout.title': 'Custom Zoom Out',
|
||||
// 'controls.fitview.title': 'Custom Fit View',
|
||||
'controls.interactive.title': 'Custom Toggle Interactivity',
|
||||
'controls.zoomin.ariaLabel': 'Custom Zoom in',
|
||||
'controls.zoomout.ariaLabel': 'Custom Zoom Out',
|
||||
// 'controls.fitview.ariaLabel': 'Custom Fit View',
|
||||
'controls.interactive.ariaLabel': 'Custom Toggle Interactivity',
|
||||
'minimap.ariaLabel': 'Custom Aria Label',
|
||||
};
|
||||
|
||||
@@ -76,7 +76,7 @@ const A11y = () => {
|
||||
elevateEdgesOnSelect
|
||||
elevateNodesOnSelect={false}
|
||||
nodeDragThreshold={0}
|
||||
labelConfig={labelConfig}
|
||||
ariaLabelConfig={ariaLabelConfig}
|
||||
>
|
||||
<Background variant={BackgroundVariant.Dots} />
|
||||
<MiniMap />
|
||||
|
||||
Reference in New Issue
Block a user