feat(components): add ReactFlowProvider #275

This commit is contained in:
moklick
2020-06-02 18:34:02 +02:00
parent 3f3a79b5f6
commit 5cbeda5c3f
12 changed files with 166 additions and 34 deletions
+6 -6
View File
@@ -19,6 +19,7 @@ import {
SelectionRect,
HandleType,
SetConnectionId,
NodePosUpdate,
} from '../types';
type TransformXYK = {
@@ -27,11 +28,6 @@ type TransformXYK = {
k: number;
};
type NodePosUpdate = {
id: ElementId;
pos: XYPosition;
};
type NodeDimensionUpdate = {
id: ElementId;
nodeElement: HTMLDivElement;
@@ -87,6 +83,8 @@ export interface StoreModel {
isInteractive: boolean;
reactFlowVersion: string;
onConnect: OnConnectFunc;
setOnConnect: Action<StoreModel, OnConnectFunc>;
@@ -126,7 +124,7 @@ export interface StoreModel {
unsetUserSelection: Action<StoreModel>;
}
const storeModel: StoreModel = {
export const storeModel: StoreModel = {
width: 0,
height: 0,
transform: [0, 0, 1],
@@ -163,6 +161,8 @@ const storeModel: StoreModel = {
isInteractive: true,
reactFlowVersion: __REACT_FLOW_VERSION__,
onConnect: () => {},
setOnConnect: action((state, onConnect) => {