chore: update LabelConfig name, add to store, create a11y example

This commit is contained in:
Abbey Yacoe
2025-05-20 17:20:46 +02:00
parent 07265ed277
commit ee8709b5fb
12 changed files with 142 additions and 37 deletions
+9
View File
@@ -36,3 +36,12 @@ export const infiniteExtent: CoordinateExtent = [
];
export const elementSelectionKeys = ['Enter', ' ', 'Escape'];
export const defaultLabelConfig = {
'a11yDescription.node.default':
'Press enter or space to select a node. Press delete to remove it and escape to cancel.',
'a11yDescription.node.keyboardDisabled':
'Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.',
'a11yDescription.edge.default':
'Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.',
};
+1 -1
View File
@@ -314,7 +314,7 @@ export type OnBeforeDeleteBase<NodeType extends NodeBase = NodeBase, EdgeType ex
edges: EdgeType[];
}) => Promise<boolean | { nodes: NodeType[]; edges: EdgeType[] }>;
export type descriptions = {
export type LabelConfig = {
'a11yDescription.node.default'?: string;
'a11yDescription.node.keyboardDisabled'?: string;
'a11yDescription.edge.default'?: string;