chore: update LabelConfig name, add to store, create a11y example
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user