feat(props): add connection mode closes #702
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
NodeDiffUpdate,
|
||||
TranslateExtent,
|
||||
SnapGrid,
|
||||
ConnectionMode,
|
||||
} from '../types';
|
||||
|
||||
type NodeDimensionUpdate = {
|
||||
@@ -70,6 +71,7 @@ export interface StoreModel {
|
||||
connectionHandleId: ElementId | null;
|
||||
connectionHandleType: HandleType | null;
|
||||
connectionPosition: XYPosition;
|
||||
connectionMode: ConnectionMode;
|
||||
|
||||
snapToGrid: boolean;
|
||||
snapGrid: SnapGrid;
|
||||
@@ -136,6 +138,8 @@ export interface StoreModel {
|
||||
unsetUserSelection: Action<StoreModel>;
|
||||
|
||||
setMultiSelectionActive: Action<StoreModel, boolean>;
|
||||
|
||||
setConnectionMode: Action<StoreModel, ConnectionMode>;
|
||||
}
|
||||
|
||||
export const storeModel: StoreModel = {
|
||||
@@ -175,6 +179,7 @@ export const storeModel: StoreModel = {
|
||||
connectionHandleId: null,
|
||||
connectionHandleType: 'source',
|
||||
connectionPosition: { x: 0, y: 0 },
|
||||
connectionMode: ConnectionMode.Strict,
|
||||
|
||||
snapGrid: [15, 15],
|
||||
snapToGrid: false,
|
||||
@@ -500,6 +505,10 @@ export const storeModel: StoreModel = {
|
||||
setMultiSelectionActive: action((state, isActive) => {
|
||||
state.multiSelectionActive = isActive;
|
||||
}),
|
||||
|
||||
setConnectionMode: action((state, connectionMode) => {
|
||||
state.connectionMode = connectionMode;
|
||||
}),
|
||||
};
|
||||
|
||||
const nodeEnv: string = (typeof __ENV__ !== 'undefined' && __ENV__) as string;
|
||||
|
||||
Reference in New Issue
Block a user