feat(components): add ReactFlowProvider #275
This commit is contained in:
+6
-6
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user