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
+6
View File
@@ -14,6 +14,7 @@ import {
NodeOrigin,
CoordinateExtent,
fitViewport,
LabelConfig,
} from '@xyflow/system';
import { applyEdgeChanges, applyNodeChanges, createSelectionChange, getSelectionChanges } from '../utils/changes';
@@ -370,6 +371,11 @@ const createStore = ({
},
reset: () => set({ ...getInitialState() }),
updateLabelConfig: (newLabelConfig: Partial<LabelConfig>) => {
set((state) => ({
labelConfig: { ...state.labelConfig, ...newLabelConfig },
}));
},
};
}, Object.is);
+2
View File
@@ -10,6 +10,7 @@ import {
NodeOrigin,
initialConnection,
CoordinateExtent,
defaultLabelConfig,
} from '@xyflow/system';
import type { Edge, FitViewOptions, InternalNode, Node, ReactFlowStore } from '../types';
@@ -141,6 +142,7 @@ const getInitialState = ({
lib: 'react',
debug: false,
labelConfig: defaultLabelConfig,
};
};