remove dist folder from repo, add .npmignore
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -4,4 +4,5 @@ node_modules
|
||||
examples/build
|
||||
cypress/videos
|
||||
cypress/screenshots
|
||||
stats.html
|
||||
stats.html
|
||||
dist
|
||||
9
.npmignore
Normal file
9
.npmignore
Normal file
@@ -0,0 +1,9 @@
|
||||
.DS_Store
|
||||
.cache
|
||||
.vscode
|
||||
.dependabot
|
||||
node_modules
|
||||
examples
|
||||
cypress
|
||||
stats.html
|
||||
dist
|
||||
@@ -4,5 +4,10 @@
|
||||
},
|
||||
"github": {
|
||||
"release": true
|
||||
},
|
||||
"hooks": {
|
||||
"before:init": ["npm test"],
|
||||
"after:bump": "npm run build",
|
||||
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
|
||||
}
|
||||
}
|
||||
|
||||
10549
dist/ReactFlow.esm.js
vendored
10549
dist/ReactFlow.esm.js
vendored
File diff suppressed because it is too large
Load Diff
1
dist/ReactFlow.esm.js.map
vendored
1
dist/ReactFlow.esm.js.map
vendored
File diff suppressed because one or more lines are too long
10563
dist/ReactFlow.js
vendored
10563
dist/ReactFlow.js
vendored
File diff suppressed because it is too large
Load Diff
1
dist/ReactFlow.js.map
vendored
1
dist/ReactFlow.js.map
vendored
File diff suppressed because one or more lines are too long
10
dist/components/BackgroundGrid/index.d.ts
vendored
10
dist/components/BackgroundGrid/index.d.ts
vendored
@@ -1,10 +0,0 @@
|
||||
import React, { HTMLAttributes } from 'react';
|
||||
import { GridType } from '../../types';
|
||||
interface GridProps extends HTMLAttributes<SVGElement> {
|
||||
backgroundType?: GridType;
|
||||
gap?: number;
|
||||
color?: string;
|
||||
size?: number;
|
||||
}
|
||||
declare const Grid: React.MemoExoticComponent<({ gap, color, size, style, className, backgroundType, }: GridProps) => JSX.Element>;
|
||||
export default Grid;
|
||||
15
dist/components/ConnectionLine/index.d.ts
vendored
15
dist/components/ConnectionLine/index.d.ts
vendored
@@ -1,15 +0,0 @@
|
||||
import { SVGAttributes } from 'react';
|
||||
import { ElementId, Node, Transform } from '../../types';
|
||||
interface ConnectionLineProps {
|
||||
connectionSourceId: ElementId;
|
||||
connectionPositionX: number;
|
||||
connectionPositionY: number;
|
||||
connectionLineType?: string | null;
|
||||
nodes: Node[];
|
||||
transform: Transform;
|
||||
isInteractive: boolean;
|
||||
connectionLineStyle?: SVGAttributes<{}>;
|
||||
className?: string;
|
||||
}
|
||||
declare const _default: ({ connectionSourceId, connectionLineStyle, connectionPositionX, connectionPositionY, connectionLineType, nodes, className, transform, isInteractive, }: ConnectionLineProps) => JSX.Element | null;
|
||||
export default _default;
|
||||
4
dist/components/Edges/BezierEdge.d.ts
vendored
4
dist/components/Edges/BezierEdge.d.ts
vendored
@@ -1,4 +0,0 @@
|
||||
import React from 'react';
|
||||
import { EdgeBezierProps } from '../../types';
|
||||
declare const _default: React.MemoExoticComponent<({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style, }: EdgeBezierProps) => JSX.Element>;
|
||||
export default _default;
|
||||
4
dist/components/Edges/StepEdge.d.ts
vendored
4
dist/components/Edges/StepEdge.d.ts
vendored
@@ -1,4 +0,0 @@
|
||||
import React from 'react';
|
||||
import { EdgeProps } from '../../types';
|
||||
declare const _default: React.MemoExoticComponent<({ sourceX, sourceY, targetX, targetY, style }: EdgeProps) => JSX.Element>;
|
||||
export default _default;
|
||||
4
dist/components/Edges/StraightEdge.d.ts
vendored
4
dist/components/Edges/StraightEdge.d.ts
vendored
@@ -1,4 +0,0 @@
|
||||
import React from 'react';
|
||||
import { EdgeProps } from '../../types';
|
||||
declare const _default: React.MemoExoticComponent<({ sourceX, sourceY, targetX, targetY, style }: EdgeProps) => JSX.Element>;
|
||||
export default _default;
|
||||
14
dist/components/Edges/wrapEdge.d.ts
vendored
14
dist/components/Edges/wrapEdge.d.ts
vendored
@@ -1,14 +0,0 @@
|
||||
import React from 'react';
|
||||
import { ElementId, Edge, EdgeCompProps } from '../../types';
|
||||
interface EdgeWrapperProps {
|
||||
id: ElementId;
|
||||
source: ElementId;
|
||||
target: ElementId;
|
||||
type: any;
|
||||
onClick: (edge: Edge) => void;
|
||||
animated: boolean;
|
||||
selected: boolean;
|
||||
isInteractive: boolean;
|
||||
}
|
||||
declare const _default: (EdgeComponent: React.ComponentType<EdgeCompProps>) => React.MemoExoticComponent<({ id, source, target, type, animated, selected, onClick, isInteractive, ...rest }: EdgeWrapperProps) => JSX.Element>;
|
||||
export default _default;
|
||||
17
dist/components/Handle/BaseHandle.d.ts
vendored
17
dist/components/Handle/BaseHandle.d.ts
vendored
@@ -1,17 +0,0 @@
|
||||
import React from 'react';
|
||||
import { HandleType, ElementId, Position, XYPosition, OnConnectFunc, Connection } from '../../types';
|
||||
declare type ValidConnectionFunc = (connection: Connection) => boolean;
|
||||
declare type SetSourceIdFunc = (nodeId: ElementId | null) => void;
|
||||
interface BaseHandleProps {
|
||||
type: HandleType;
|
||||
nodeId: ElementId;
|
||||
onConnect: OnConnectFunc;
|
||||
position: Position;
|
||||
setSourceId: SetSourceIdFunc;
|
||||
setPosition: (pos: XYPosition) => void;
|
||||
isValidConnection: ValidConnectionFunc;
|
||||
id?: ElementId | boolean;
|
||||
className?: string;
|
||||
}
|
||||
declare const BaseHandle: React.MemoExoticComponent<({ type, nodeId, onConnect, position, setSourceId, setPosition, className, id, isValidConnection, ...rest }: BaseHandleProps) => JSX.Element>;
|
||||
export default BaseHandle;
|
||||
10
dist/components/Handle/index.d.ts
vendored
10
dist/components/Handle/index.d.ts
vendored
@@ -1,10 +0,0 @@
|
||||
import React from 'react';
|
||||
import { HandleType, Position, OnConnectFunc } from '../../types';
|
||||
interface HandleProps {
|
||||
type: HandleType;
|
||||
position: Position;
|
||||
onConnect?: OnConnectFunc;
|
||||
isValidConnection?: () => boolean;
|
||||
}
|
||||
declare const Handle: React.MemoExoticComponent<({ onConnect, type, position, isValidConnection, ...rest }: HandleProps) => JSX.Element>;
|
||||
export default Handle;
|
||||
4
dist/components/Nodes/DefaultNode.d.ts
vendored
4
dist/components/Nodes/DefaultNode.d.ts
vendored
@@ -1,4 +0,0 @@
|
||||
/// <reference types="react" />
|
||||
import { NodeProps } from '../../types';
|
||||
declare const _default: ({ data, targetPosition, sourcePosition, style }: NodeProps) => JSX.Element;
|
||||
export default _default;
|
||||
4
dist/components/Nodes/InputNode.d.ts
vendored
4
dist/components/Nodes/InputNode.d.ts
vendored
@@ -1,4 +0,0 @@
|
||||
/// <reference types="react" />
|
||||
import { NodeProps } from '../../types';
|
||||
declare const _default: ({ data, style, sourcePosition }: NodeProps) => JSX.Element;
|
||||
export default _default;
|
||||
4
dist/components/Nodes/OutputNode.d.ts
vendored
4
dist/components/Nodes/OutputNode.d.ts
vendored
@@ -1,4 +0,0 @@
|
||||
/// <reference types="react" />
|
||||
import { NodeProps } from '../../types';
|
||||
declare const _default: ({ data, style, targetPosition }: NodeProps) => JSX.Element;
|
||||
export default _default;
|
||||
2
dist/components/Nodes/utils.d.ts
vendored
2
dist/components/Nodes/utils.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
import { HandleElement } from '../../types';
|
||||
export declare const getHandleBounds: (selector: string, nodeElement: HTMLDivElement, parentBounds: ClientRect | DOMRect, k: number) => HandleElement[] | null;
|
||||
4
dist/components/Nodes/wrapNode.d.ts
vendored
4
dist/components/Nodes/wrapNode.d.ts
vendored
@@ -1,4 +0,0 @@
|
||||
import React from 'react';
|
||||
import { NodeComponentProps, WrapNodeProps } from '../../types';
|
||||
declare const _default: (NodeComponent: React.ComponentType<NodeComponentProps>) => React.MemoExoticComponent<({ id, type, data, transform, xPos, yPos, selected, onClick, onNodeDragStop, style, isInteractive, sourcePosition, targetPosition, }: WrapNodeProps) => JSX.Element>;
|
||||
export default _default;
|
||||
7
dist/components/NodesSelection/index.d.ts
vendored
7
dist/components/NodesSelection/index.d.ts
vendored
@@ -1,7 +0,0 @@
|
||||
/**
|
||||
* The nodes selection rectangle gets displayed when a user
|
||||
* made a selectio with on or several nodes
|
||||
*/
|
||||
import React from 'react';
|
||||
declare const _default: React.MemoExoticComponent<() => JSX.Element>;
|
||||
export default _default;
|
||||
9
dist/components/UserSelection/index.d.ts
vendored
9
dist/components/UserSelection/index.d.ts
vendored
@@ -1,9 +0,0 @@
|
||||
/**
|
||||
* The user selection rectangle gets displayed when a user drags the mouse while pressing shift
|
||||
*/
|
||||
import React from 'react';
|
||||
declare type UserSelectionProps = {
|
||||
isInteractive: boolean;
|
||||
};
|
||||
declare const _default: React.MemoExoticComponent<({ isInteractive }: UserSelectionProps) => JSX.Element | null>;
|
||||
export default _default;
|
||||
11
dist/container/EdgeRenderer/index.d.ts
vendored
11
dist/container/EdgeRenderer/index.d.ts
vendored
@@ -1,11 +0,0 @@
|
||||
import React, { SVGAttributes } from 'react';
|
||||
interface EdgeRendererProps {
|
||||
width: number;
|
||||
height: number;
|
||||
edgeTypes: any;
|
||||
connectionLineStyle?: SVGAttributes<{}>;
|
||||
connectionLineType?: string;
|
||||
onElementClick?: () => void;
|
||||
}
|
||||
declare const EdgeRenderer: React.MemoExoticComponent<(props: EdgeRendererProps) => JSX.Element | null>;
|
||||
export default EdgeRenderer;
|
||||
2
dist/container/EdgeRenderer/utils.d.ts
vendored
2
dist/container/EdgeRenderer/utils.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
import { EdgeTypesType } from '../../types';
|
||||
export declare function createEdgeTypes(edgeTypes: EdgeTypesType): EdgeTypesType;
|
||||
27
dist/container/GraphView/index.d.ts
vendored
27
dist/container/GraphView/index.d.ts
vendored
@@ -1,27 +0,0 @@
|
||||
import React, { SVGAttributes } from 'react';
|
||||
import { Elements, NodeTypesType, EdgeTypesType, GridType, OnLoadFunc } from '../../types';
|
||||
export interface GraphViewProps {
|
||||
elements: Elements;
|
||||
onElementClick: () => void;
|
||||
onElementsRemove: (elements: Elements) => void;
|
||||
onNodeDragStop: () => void;
|
||||
onConnect: () => void;
|
||||
onLoad: OnLoadFunc;
|
||||
onMove: () => void;
|
||||
selectionKeyCode: number;
|
||||
nodeTypes: NodeTypesType;
|
||||
edgeTypes: EdgeTypesType;
|
||||
connectionLineType: string;
|
||||
connectionLineStyle: SVGAttributes<{}>;
|
||||
deleteKeyCode: number;
|
||||
showBackground: boolean;
|
||||
backgroundGap: number;
|
||||
backgroundColor: string;
|
||||
backgroundType: GridType;
|
||||
snapToGrid: boolean;
|
||||
snapGrid: [number, number];
|
||||
onlyRenderVisibleNodes: boolean;
|
||||
isInteractive: boolean;
|
||||
}
|
||||
declare const GraphView: React.MemoExoticComponent<({ nodeTypes, edgeTypes, onMove, onLoad, onElementClick, onNodeDragStop, connectionLineType, connectionLineStyle, selectionKeyCode, onElementsRemove, deleteKeyCode, elements, showBackground, backgroundGap, backgroundColor, backgroundType, onConnect, snapToGrid, snapGrid, onlyRenderVisibleNodes, isInteractive, }: GraphViewProps) => JSX.Element>;
|
||||
export default GraphView;
|
||||
10
dist/container/NodeRenderer/index.d.ts
vendored
10
dist/container/NodeRenderer/index.d.ts
vendored
@@ -1,10 +0,0 @@
|
||||
import React from 'react';
|
||||
import { NodeTypesType } from '../../types';
|
||||
interface NodeRendererProps {
|
||||
nodeTypes: NodeTypesType;
|
||||
onElementClick: () => void;
|
||||
onNodeDragStop: () => void;
|
||||
onlyRenderVisibleNodes?: boolean;
|
||||
}
|
||||
declare const NodeRenderer: React.MemoExoticComponent<({ onlyRenderVisibleNodes, ...props }: NodeRendererProps) => JSX.Element>;
|
||||
export default NodeRenderer;
|
||||
2
dist/container/NodeRenderer/utils.d.ts
vendored
2
dist/container/NodeRenderer/utils.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
import { NodeTypesType } from '../../types';
|
||||
export declare function createNodeTypes(nodeTypes: NodeTypesType): NodeTypesType;
|
||||
61
dist/container/ReactFlow/index.d.ts
vendored
61
dist/container/ReactFlow/index.d.ts
vendored
@@ -1,61 +0,0 @@
|
||||
import React, { SVGAttributes, HTMLAttributes } from 'react';
|
||||
import { Elements, NodeTypesType, EdgeTypesType, GridType, OnLoadFunc } from '../../types';
|
||||
import '../../style.css';
|
||||
export interface ReactFlowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onLoad'> {
|
||||
elements: Elements;
|
||||
onElementClick: () => void;
|
||||
onElementsRemove: (elements: Elements) => void;
|
||||
onNodeDragStop: () => void;
|
||||
onConnect: () => void;
|
||||
onLoad: OnLoadFunc;
|
||||
onMove: () => void;
|
||||
nodeTypes: NodeTypesType;
|
||||
edgeTypes: EdgeTypesType;
|
||||
connectionLineType: string;
|
||||
connectionLineStyle: SVGAttributes<{}>;
|
||||
deleteKeyCode: number;
|
||||
selectionKeyCode: number;
|
||||
showBackground: boolean;
|
||||
backgroundGap: number;
|
||||
backgroundColor: string;
|
||||
backgroundType: GridType;
|
||||
snapToGrid: boolean;
|
||||
snapGrid: [number, number];
|
||||
onlyRenderVisibleNodes: boolean;
|
||||
isInteractive: boolean;
|
||||
}
|
||||
declare const ReactFlow: {
|
||||
({ style, onElementClick, elements, children, nodeTypes, edgeTypes, onLoad, onMove, onElementsRemove, onConnect, onNodeDragStop, connectionLineType, connectionLineStyle, deleteKeyCode, selectionKeyCode, showBackground, backgroundGap, backgroundType, backgroundColor, snapToGrid, snapGrid, onlyRenderVisibleNodes, isInteractive, }: ReactFlowProps): JSX.Element;
|
||||
displayName: string;
|
||||
defaultProps: {
|
||||
onElementClick: () => void;
|
||||
onElementsRemove: () => void;
|
||||
onNodeDragStop: () => void;
|
||||
onConnect: () => void;
|
||||
onLoad: () => void;
|
||||
onMove: () => void;
|
||||
nodeTypes: {
|
||||
input: ({ data, style, sourcePosition }: import("../../types").NodeProps) => JSX.Element;
|
||||
default: ({ data, targetPosition, sourcePosition, style }: import("../../types").NodeProps) => JSX.Element;
|
||||
output: ({ data, style, targetPosition }: import("../../types").NodeProps) => JSX.Element;
|
||||
};
|
||||
edgeTypes: {
|
||||
default: React.MemoExoticComponent<({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style, }: import("../../types").EdgeBezierProps) => JSX.Element>;
|
||||
straight: React.MemoExoticComponent<({ sourceX, sourceY, targetX, targetY, style }: import("../../types").EdgeProps) => JSX.Element>;
|
||||
step: React.MemoExoticComponent<({ sourceX, sourceY, targetX, targetY, style }: import("../../types").EdgeProps) => JSX.Element>;
|
||||
};
|
||||
connectionLineType: string;
|
||||
connectionLineStyle: {};
|
||||
deleteKeyCode: number;
|
||||
selectionKeyCode: number;
|
||||
backgroundColor: string;
|
||||
backgroundGap: number;
|
||||
showBackground: boolean;
|
||||
backgroundType: GridType;
|
||||
snapToGrid: boolean;
|
||||
snapGrid: number[];
|
||||
onlyRenderVisibleNodes: boolean;
|
||||
isInteractive: boolean;
|
||||
};
|
||||
};
|
||||
export default ReactFlow;
|
||||
7
dist/contexts/NodeIdContext.d.ts
vendored
7
dist/contexts/NodeIdContext.d.ts
vendored
@@ -1,7 +0,0 @@
|
||||
/// <reference types="react" />
|
||||
import { ElementId } from '../types';
|
||||
declare type ContextProps = ElementId | null;
|
||||
export declare const NodeIdContext: import("react").Context<ContextProps>;
|
||||
export declare const Provider: import("react").Provider<ContextProps>;
|
||||
export declare const Consumer: import("react").Consumer<ContextProps>;
|
||||
export default NodeIdContext;
|
||||
3
dist/hooks/useD3Zoom.d.ts
vendored
3
dist/hooks/useD3Zoom.d.ts
vendored
@@ -1,3 +0,0 @@
|
||||
import { MutableRefObject } from 'react';
|
||||
declare const _default: (zoomPane: MutableRefObject<Element | null>, onMove: () => void, shiftPressed: boolean) => void;
|
||||
export default _default;
|
||||
3
dist/hooks/useElementUpdater.d.ts
vendored
3
dist/hooks/useElementUpdater.d.ts
vendored
@@ -1,3 +0,0 @@
|
||||
import { Elements } from '../types';
|
||||
declare const useElementUpdater: (elements: Elements) => void;
|
||||
export default useElementUpdater;
|
||||
7
dist/hooks/useGlobalKeyHandler.d.ts
vendored
7
dist/hooks/useGlobalKeyHandler.d.ts
vendored
@@ -1,7 +0,0 @@
|
||||
import { Elements } from '../types';
|
||||
interface HookParams {
|
||||
deleteKeyCode: number;
|
||||
onElementsRemove: (elements: Elements) => void;
|
||||
}
|
||||
declare const _default: ({ deleteKeyCode, onElementsRemove }: HookParams) => void;
|
||||
export default _default;
|
||||
2
dist/hooks/useKeyPress.d.ts
vendored
2
dist/hooks/useKeyPress.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
declare const _default: (keyCode: number) => boolean;
|
||||
export default _default;
|
||||
5
dist/index.d.ts
vendored
5
dist/index.d.ts
vendored
@@ -1,5 +0,0 @@
|
||||
import ReactFlow from './container/ReactFlow';
|
||||
export default ReactFlow;
|
||||
export { default as Handle } from './components/Handle';
|
||||
export { MiniMap, Controls } from './plugins';
|
||||
export { isNode, isEdge, removeElements, addEdge, getOutgoers, } from './utils/graph';
|
||||
5
dist/plugins/Controls/index.d.ts
vendored
5
dist/plugins/Controls/index.d.ts
vendored
@@ -1,5 +0,0 @@
|
||||
import React from 'react';
|
||||
interface ControlProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
}
|
||||
declare const _default: ({ style, className }: ControlProps) => JSX.Element;
|
||||
export default _default;
|
||||
10
dist/plugins/MiniMap/index.d.ts
vendored
10
dist/plugins/MiniMap/index.d.ts
vendored
@@ -1,10 +0,0 @@
|
||||
import React from 'react';
|
||||
import { Node } from '../../types';
|
||||
declare type StringFunc = (node: Node) => string;
|
||||
interface MiniMapProps extends React.HTMLAttributes<SVGSVGElement> {
|
||||
nodeColor: string | StringFunc;
|
||||
nodeBorderRadius: number;
|
||||
maskColor: string;
|
||||
}
|
||||
declare const _default: ({ style, className, nodeColor, nodeBorderRadius, maskColor, }: MiniMapProps) => JSX.Element;
|
||||
export default _default;
|
||||
2
dist/plugins/index.d.ts
vendored
2
dist/plugins/index.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export { default as MiniMap } from './MiniMap';
|
||||
export { default as Controls } from './Controls';
|
||||
71
dist/store/hooks.d.ts
vendored
71
dist/store/hooks.d.ts
vendored
@@ -1,71 +0,0 @@
|
||||
import { StoreModel } from './index';
|
||||
export declare const useStoreActions: <Result>(mapActions: (actions: import("easy-peasy").ActionMapper<{
|
||||
selectedNodesBbox: import("../types").Rect;
|
||||
d3Zoom: import("d3-zoom").ZoomBehavior<Element, unknown> | null;
|
||||
d3Selection: import("d3-selection").Selection<Element, unknown, null, undefined> | null;
|
||||
selection: import("../types").SelectionRect | null;
|
||||
userSelectionRect: import("../types").SelectionRect;
|
||||
connectionPosition: import("../types").XYPosition;
|
||||
onConnect: import("../types").OnConnectFunc;
|
||||
setOnConnect: import("easy-peasy").Action<StoreModel, import("../types").OnConnectFunc>;
|
||||
setNodes: import("easy-peasy").Action<StoreModel, import("../types").Node[]>;
|
||||
setEdges: import("easy-peasy").Action<StoreModel, import("../types").Edge[]>;
|
||||
updateNodeDimensions: import("easy-peasy").Action<StoreModel, {
|
||||
id: string;
|
||||
nodeElement: HTMLDivElement;
|
||||
}>;
|
||||
updateNodePos: import("easy-peasy").Action<StoreModel, {
|
||||
id: string;
|
||||
pos: import("../types").XYPosition;
|
||||
}>;
|
||||
setSelection: import("easy-peasy").Action<StoreModel, boolean>;
|
||||
setNodesSelection: import("easy-peasy").Action<StoreModel, {
|
||||
isActive: boolean;
|
||||
selection?: import("../types").SelectionRect | undefined;
|
||||
}>;
|
||||
setSelectedElements: import("easy-peasy").Action<StoreModel, import("../types").Node | import("../types").Edge | import("../types").Elements>;
|
||||
updateSelection: import("easy-peasy").Action<StoreModel, import("../types").SelectionRect>;
|
||||
updateTransform: import("easy-peasy").Action<StoreModel, {
|
||||
x: number;
|
||||
y: number;
|
||||
k: number;
|
||||
}>;
|
||||
updateSize: import("easy-peasy").Action<StoreModel, import("../types").Dimensions>;
|
||||
initD3: import("easy-peasy").Action<StoreModel, {
|
||||
zoom: import("d3-zoom").ZoomBehavior<Element, unknown>;
|
||||
selection: import("d3-selection").Selection<Element, unknown, null, undefined>;
|
||||
}>;
|
||||
setSnapGrid: import("easy-peasy").Action<StoreModel, {
|
||||
snapToGrid: boolean;
|
||||
snapGrid: [number, number];
|
||||
}>;
|
||||
setConnectionPosition: import("easy-peasy").Action<StoreModel, import("../types").XYPosition>;
|
||||
setConnectionSourceId: import("easy-peasy").Action<StoreModel, string | null>;
|
||||
setInteractive: import("easy-peasy").Action<StoreModel, boolean>;
|
||||
setUserSelection: import("easy-peasy").Action<StoreModel, import("../types").XYPosition>;
|
||||
updateUserSelection: import("easy-peasy").Action<StoreModel, import("../types").XYPosition>;
|
||||
unsetUserSelection: import("easy-peasy").Action<StoreModel, void>;
|
||||
}, "1">) => Result) => Result;
|
||||
export declare const useStoreDispatch: () => import("easy-peasy").Dispatch<StoreModel, import("redux").Action<any>>;
|
||||
export declare const useStoreState: <Result>(mapState: (state: import("easy-peasy").StateMapper<{
|
||||
width: number;
|
||||
height: number;
|
||||
transform: import("../types").Transform;
|
||||
nodes: import("../types").Node[];
|
||||
edges: import("../types").Edge[];
|
||||
selectedElements: import("../types").Elements;
|
||||
selectedNodesBbox: import("../types").Rect;
|
||||
d3Zoom: import("d3-zoom").ZoomBehavior<Element, unknown> | null;
|
||||
d3Selection: import("d3-selection").Selection<Element, unknown, null, undefined> | null;
|
||||
d3Initialised: boolean;
|
||||
nodesSelectionActive: boolean;
|
||||
selectionActive: boolean;
|
||||
selection: import("../types").SelectionRect | null;
|
||||
userSelectionRect: import("../types").SelectionRect;
|
||||
connectionSourceId: string | null;
|
||||
connectionPosition: import("../types").XYPosition;
|
||||
snapToGrid: boolean;
|
||||
snapGrid: [number, number];
|
||||
isInteractive: boolean;
|
||||
onConnect: import("../types").OnConnectFunc;
|
||||
}, "1">) => Result, equalityFn?: ((prev: Result, next: Result) => boolean) | undefined) => Result;
|
||||
71
dist/store/index.d.ts
vendored
71
dist/store/index.d.ts
vendored
@@ -1,71 +0,0 @@
|
||||
import { Action } from 'easy-peasy';
|
||||
import { Selection as D3Selection, ZoomBehavior } from 'd3';
|
||||
import { ElementId, Elements, Transform, Node, Edge, Rect, Dimensions, XYPosition, OnConnectFunc, SelectionRect } from '../types';
|
||||
declare type TransformXYK = {
|
||||
x: number;
|
||||
y: number;
|
||||
k: number;
|
||||
};
|
||||
declare type NodePosUpdate = {
|
||||
id: ElementId;
|
||||
pos: XYPosition;
|
||||
};
|
||||
declare type NodeDimensionUpdate = {
|
||||
id: ElementId;
|
||||
nodeElement: HTMLDivElement;
|
||||
};
|
||||
declare type SelectionUpdate = {
|
||||
isActive: boolean;
|
||||
selection?: SelectionRect;
|
||||
};
|
||||
declare type D3Init = {
|
||||
zoom: ZoomBehavior<Element, unknown>;
|
||||
selection: D3Selection<Element, unknown, null, undefined>;
|
||||
};
|
||||
declare type SetSnapGrid = {
|
||||
snapToGrid: boolean;
|
||||
snapGrid: [number, number];
|
||||
};
|
||||
export interface StoreModel {
|
||||
width: number;
|
||||
height: number;
|
||||
transform: Transform;
|
||||
nodes: Node[];
|
||||
edges: Edge[];
|
||||
selectedElements: Elements;
|
||||
selectedNodesBbox: Rect;
|
||||
d3Zoom: ZoomBehavior<Element, unknown> | null;
|
||||
d3Selection: D3Selection<Element, unknown, null, undefined> | null;
|
||||
d3Initialised: boolean;
|
||||
nodesSelectionActive: boolean;
|
||||
selectionActive: boolean;
|
||||
selection: SelectionRect | null;
|
||||
userSelectionRect: SelectionRect;
|
||||
connectionSourceId: ElementId | null;
|
||||
connectionPosition: XYPosition;
|
||||
snapToGrid: boolean;
|
||||
snapGrid: [number, number];
|
||||
isInteractive: boolean;
|
||||
onConnect: OnConnectFunc;
|
||||
setOnConnect: Action<StoreModel, OnConnectFunc>;
|
||||
setNodes: Action<StoreModel, Node[]>;
|
||||
setEdges: Action<StoreModel, Edge[]>;
|
||||
updateNodeDimensions: Action<StoreModel, NodeDimensionUpdate>;
|
||||
updateNodePos: Action<StoreModel, NodePosUpdate>;
|
||||
setSelection: Action<StoreModel, boolean>;
|
||||
setNodesSelection: Action<StoreModel, SelectionUpdate>;
|
||||
setSelectedElements: Action<StoreModel, Elements | Node | Edge>;
|
||||
updateSelection: Action<StoreModel, SelectionRect>;
|
||||
updateTransform: Action<StoreModel, TransformXYK>;
|
||||
updateSize: Action<StoreModel, Dimensions>;
|
||||
initD3: Action<StoreModel, D3Init>;
|
||||
setSnapGrid: Action<StoreModel, SetSnapGrid>;
|
||||
setConnectionPosition: Action<StoreModel, XYPosition>;
|
||||
setConnectionSourceId: Action<StoreModel, ElementId | null>;
|
||||
setInteractive: Action<StoreModel, boolean>;
|
||||
setUserSelection: Action<StoreModel, XYPosition>;
|
||||
updateUserSelection: Action<StoreModel, XYPosition>;
|
||||
unsetUserSelection: Action<StoreModel>;
|
||||
}
|
||||
declare const store: import("easy-peasy").Store<StoreModel, import("easy-peasy").EasyPeasyConfig<{}, any>>;
|
||||
export default store;
|
||||
134
dist/types/index.d.ts
vendored
134
dist/types/index.d.ts
vendored
@@ -1,134 +0,0 @@
|
||||
import { CSSProperties, SVGAttributes } from 'react';
|
||||
export declare type ElementId = string;
|
||||
export declare type Elements = Array<Node | Edge>;
|
||||
export declare type Transform = [number, number, number];
|
||||
export declare enum Position {
|
||||
Left = "left",
|
||||
Top = "top",
|
||||
Right = "right",
|
||||
Bottom = "bottom"
|
||||
}
|
||||
export declare type XYPosition = {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
export declare enum GridType {
|
||||
Lines = "lines",
|
||||
Dots = "dots"
|
||||
}
|
||||
export declare type HandleType = 'source' | 'target';
|
||||
export declare type NodeTypesType = {
|
||||
[key: string]: React.ReactNode;
|
||||
};
|
||||
export declare type EdgeTypesType = NodeTypesType;
|
||||
export interface Dimensions {
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
export interface Rect extends Dimensions, XYPosition {
|
||||
}
|
||||
export interface Box extends XYPosition {
|
||||
x2: number;
|
||||
y2: number;
|
||||
}
|
||||
export interface SelectionRect extends Rect {
|
||||
startX: number;
|
||||
startY: number;
|
||||
draw: boolean;
|
||||
}
|
||||
export interface Node {
|
||||
id: ElementId;
|
||||
position: XYPosition;
|
||||
type?: string;
|
||||
__rg?: any;
|
||||
data?: any;
|
||||
style?: CSSProperties;
|
||||
targetPosition?: Position;
|
||||
sourcePosition?: Position;
|
||||
}
|
||||
export interface Edge {
|
||||
id: ElementId;
|
||||
type?: string;
|
||||
source: ElementId;
|
||||
target: ElementId;
|
||||
style?: SVGAttributes<{}>;
|
||||
animated?: boolean;
|
||||
}
|
||||
export interface EdgeProps {
|
||||
sourceX: number;
|
||||
sourceY: number;
|
||||
targetX: number;
|
||||
targetY: number;
|
||||
style?: SVGAttributes<{}>;
|
||||
}
|
||||
export interface EdgeBezierProps extends EdgeProps {
|
||||
sourcePosition: Position;
|
||||
targetPosition: Position;
|
||||
}
|
||||
export interface NodeProps {
|
||||
id: ElementId;
|
||||
type: string;
|
||||
data: any;
|
||||
selected: boolean;
|
||||
targetPosition?: Position;
|
||||
sourcePosition?: Position;
|
||||
style?: CSSProperties;
|
||||
}
|
||||
export interface NodeComponentProps {
|
||||
id: ElementId;
|
||||
type: string;
|
||||
data: any;
|
||||
selected?: boolean;
|
||||
transform?: Transform;
|
||||
xPos?: number;
|
||||
yPos?: number;
|
||||
targetPosition?: Position;
|
||||
sourcePosition?: Position;
|
||||
onClick?: (node: Node) => void | undefined;
|
||||
onNodeDragStop?: () => any;
|
||||
style?: CSSProperties;
|
||||
}
|
||||
export interface WrapNodeProps {
|
||||
id: ElementId;
|
||||
type: string;
|
||||
data: any;
|
||||
selected: boolean;
|
||||
transform: Transform;
|
||||
xPos: number;
|
||||
yPos: number;
|
||||
isInteractive: boolean;
|
||||
onClick: (node: Node) => void | undefined;
|
||||
onNodeDragStop: (node: Node) => void;
|
||||
style?: CSSProperties;
|
||||
sourcePosition?: Position;
|
||||
targetPosition?: Position;
|
||||
}
|
||||
export declare type FitViewParams = {
|
||||
padding: number;
|
||||
};
|
||||
export declare type FitViewFunc = (fitViewOptions: FitViewParams) => void;
|
||||
declare type OnLoadParams = {
|
||||
zoomIn: () => void;
|
||||
zoomOut: () => void;
|
||||
fitView: FitViewFunc;
|
||||
};
|
||||
export declare type OnLoadFunc = (params: OnLoadParams) => void;
|
||||
export declare type Connection = {
|
||||
source: ElementId | null;
|
||||
target: ElementId | null;
|
||||
};
|
||||
export declare type OnConnectFunc = (params: Connection) => void;
|
||||
export interface HandleElement extends XYPosition, Dimensions {
|
||||
id?: ElementId | null;
|
||||
position: Position;
|
||||
}
|
||||
export interface EdgeCompProps {
|
||||
id: ElementId;
|
||||
source: ElementId;
|
||||
target: ElementId;
|
||||
type: any;
|
||||
onClick?: (edge: Edge) => void;
|
||||
animated?: boolean;
|
||||
selected?: boolean;
|
||||
}
|
||||
export {};
|
||||
15
dist/utils/graph.d.ts
vendored
15
dist/utils/graph.d.ts
vendored
@@ -1,15 +0,0 @@
|
||||
import { Node, Edge, Elements, Transform, XYPosition, Rect, FitViewParams } from '../types';
|
||||
export declare const isEdge: (element: Node | Edge) => boolean;
|
||||
export declare const isNode: (element: Node | Edge) => boolean;
|
||||
export declare const getOutgoers: (node: Node, elements: Elements) => Elements;
|
||||
export declare const removeElements: (elementsToRemove: Elements, elements: Elements) => Elements;
|
||||
export declare const addEdge: (edgeParams: Edge, elements: Elements) => Elements;
|
||||
export declare const parseElement: (element: Node | Edge, transform: Transform, snapToGrid: boolean, snapGrid: [number, number]) => Node | Edge;
|
||||
export declare const getBoundsofRects: (rect1: Rect, rect2: Rect) => Rect;
|
||||
export declare const getRectOfNodes: (nodes: Node[]) => Rect;
|
||||
export declare const graphPosToZoomedPos: ({ x, y }: XYPosition, [tx, ty, tScale]: Transform) => XYPosition;
|
||||
export declare const getNodesInside: (nodes: Node[], rect: Rect, [tx, ty, tScale]?: Transform, partially?: boolean) => Node[];
|
||||
export declare const getConnectedEdges: (nodes: Node[], edges: Edge[]) => Edge[];
|
||||
export declare const fitView: ({ padding }?: FitViewParams) => void;
|
||||
export declare const zoomIn: () => void;
|
||||
export declare const zoomOut: () => void;
|
||||
6
dist/utils/index.d.ts
vendored
6
dist/utils/index.d.ts
vendored
@@ -1,6 +0,0 @@
|
||||
import { MouseEvent as ReactMouseEvent } from 'react';
|
||||
export declare const isInputDOMNode: (e: MouseEvent | ReactMouseEvent<Element, MouseEvent> | ReactMouseEvent<HTMLElement | SVGElement, MouseEvent> | import("react").TouchEvent<HTMLElement | SVGElement> | TouchEvent | KeyboardEvent) => boolean;
|
||||
export declare const getDimensions: (node: HTMLDivElement) => {
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
Reference in New Issue
Block a user