chore(labelconfig): cleanup
This commit is contained in:
@@ -41,7 +41,6 @@ function ControlsComponent({
|
||||
const store = useStoreApi();
|
||||
const { isInteractive, minZoomReached, maxZoomReached, labelConfig } = useStore(selector, shallow);
|
||||
const { zoomIn, zoomOut, fitView } = useReactFlow();
|
||||
const effectiveAriaLabel = ariaLabel ?? labelConfig['controls.ariaLabel'];
|
||||
|
||||
const onZoomInHandler = () => {
|
||||
zoomIn();
|
||||
@@ -75,7 +74,7 @@ function ControlsComponent({
|
||||
position={position}
|
||||
style={style}
|
||||
data-testid="rf__controls"
|
||||
aria-label={effectiveAriaLabel}
|
||||
aria-label={ariaLabel ?? labelConfig['controls.ariaLabel']}
|
||||
>
|
||||
{showZoom && (
|
||||
<>
|
||||
|
||||
@@ -133,7 +133,7 @@ function MiniMapComponent<NodeType extends Node = Node>({
|
||||
}, [])
|
||||
: undefined;
|
||||
|
||||
const effectiveAriaLabel = ariaLabel ?? labelConfig['minimap.ariaLabel'];
|
||||
const _ariaLabel = ariaLabel ?? labelConfig['minimap.ariaLabel'];
|
||||
|
||||
return (
|
||||
<Panel
|
||||
@@ -164,7 +164,7 @@ function MiniMapComponent<NodeType extends Node = Node>({
|
||||
ref={svg}
|
||||
onClick={onSvgClick}
|
||||
>
|
||||
{effectiveAriaLabel && <title id={labelledBy}>{effectiveAriaLabel}</title>}
|
||||
{_ariaLabel && <title id={labelledBy}>{_ariaLabel}</title>}
|
||||
|
||||
<MiniMapNodes<NodeType>
|
||||
onClick={onSvgNodeClick}
|
||||
|
||||
@@ -144,11 +144,11 @@ export function NodeWrapper<NodeType extends Node>({
|
||||
event.preventDefault();
|
||||
|
||||
store.setState({
|
||||
ariaLiveMessage: labelConfig['a11yDescription.ariaLiveMessage'](
|
||||
event.key.replace('Arrow', '').toLowerCase(),
|
||||
~~internals.positionAbsolute.x,
|
||||
~~internals.positionAbsolute.y
|
||||
),
|
||||
ariaLiveMessage: labelConfig['a11yDescription.ariaLiveMessage']({
|
||||
direction: event.key.replace('Arrow', '').toLowerCase(),
|
||||
x: ~~internals.positionAbsolute.x,
|
||||
y: ~~internals.positionAbsolute.y,
|
||||
}),
|
||||
});
|
||||
|
||||
moveSelectedNodes({
|
||||
|
||||
@@ -108,6 +108,7 @@ export {
|
||||
type NoConnection,
|
||||
type NodeConnection,
|
||||
type OnReconnect,
|
||||
type LabelConfig,
|
||||
} from '@xyflow/system';
|
||||
|
||||
// we need this workaround to prevent a duplicate identifier error
|
||||
|
||||
Reference in New Issue
Block a user