react-cosmos-diagram 0.8.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/esm/components/Edges/BaseEdge.d.ts +4 -4
- package/dist/esm/components/Edges/BaseEdge.d.ts.map +1 -1
- package/dist/esm/components/Edges/BezierEdge.d.ts +5 -2
- package/dist/esm/components/Edges/BezierEdge.d.ts.map +1 -1
- package/dist/esm/components/Edges/EdgeWrapper/index.d.ts +4 -6
- package/dist/esm/components/Edges/EdgeWrapper/index.d.ts.map +1 -1
- package/dist/esm/components/Edges/EdgeWrapper/type.d.ts +12 -16
- package/dist/esm/components/Edges/EdgeWrapper/type.d.ts.map +1 -1
- package/dist/esm/components/Edges/StepEdge.d.ts +5 -2
- package/dist/esm/components/Edges/StepEdge.d.ts.map +1 -1
- package/dist/esm/components/Edges/StraightEdge.d.ts +6 -3
- package/dist/esm/components/Edges/StraightEdge.d.ts.map +1 -1
- package/dist/esm/components/Edges/type.d.ts +0 -3
- package/dist/esm/components/Edges/type.d.ts.map +1 -1
- package/dist/esm/components/Node/NodeWrapper/index.d.ts +3 -3
- package/dist/esm/components/Node/NodeWrapper/index.d.ts.map +1 -1
- package/dist/esm/components/Node/NodeWrapper/type.d.ts +8 -8
- package/dist/esm/components/Node/NodeWrapper/type.d.ts.map +1 -1
- package/dist/esm/components/Node/index.d.ts +2 -2
- package/dist/esm/components/Node/index.d.ts.map +1 -1
- package/dist/esm/components/Node/type.d.ts +1 -1
- package/dist/esm/components/Node/type.d.ts.map +1 -1
- package/dist/esm/components/Node/utils.d.ts +4 -4
- package/dist/esm/components/Node/utils.d.ts.map +1 -1
- package/dist/esm/components/ReactDiagramProvider/type.d.ts +19 -20
- package/dist/esm/components/ReactDiagramProvider/type.d.ts.map +1 -1
- package/dist/esm/components/StoreUpdater/index.d.ts +4 -2
- package/dist/esm/components/StoreUpdater/index.d.ts.map +1 -1
- package/dist/esm/container/ConnectionLineRenderer/ConnectionPath.d.ts +4 -4
- package/dist/esm/container/ConnectionLineRenderer/ConnectionPath.d.ts.map +1 -1
- package/dist/esm/container/ConnectionLineRenderer/index.d.ts +4 -3
- package/dist/esm/container/ConnectionLineRenderer/index.d.ts.map +1 -1
- package/dist/esm/container/EdgeRenderer/index.d.ts +7 -7
- package/dist/esm/container/EdgeRenderer/index.d.ts.map +1 -1
- package/dist/esm/container/EdgeRenderer/type.d.ts +4 -4
- package/dist/esm/container/EdgeRenderer/type.d.ts.map +1 -1
- package/dist/esm/container/EdgeRenderer/utils.d.ts +2 -1
- package/dist/esm/container/EdgeRenderer/utils.d.ts.map +1 -1
- package/dist/esm/container/NodeRenderer/index.d.ts +5 -6
- package/dist/esm/container/NodeRenderer/index.d.ts.map +1 -1
- package/dist/esm/container/NodeRenderer/type.d.ts +4 -4
- package/dist/esm/container/NodeRenderer/type.d.ts.map +1 -1
- package/dist/esm/container/NodeRenderer/utils.d.ts +2 -1
- package/dist/esm/container/NodeRenderer/utils.d.ts.map +1 -1
- package/dist/esm/container/Pane/index.d.ts.map +1 -1
- package/dist/esm/container/ReactDiagram/DiagramView.d.ts +7 -8
- package/dist/esm/container/ReactDiagram/DiagramView.d.ts.map +1 -1
- package/dist/esm/container/ReactDiagram/index.d.ts +8 -66
- package/dist/esm/container/ReactDiagram/index.d.ts.map +1 -1
- package/dist/esm/contexts/RCDStoreContext.d.ts +2 -2
- package/dist/esm/contexts/RCDStoreContext.d.ts.map +1 -1
- package/dist/esm/hooks/useNodeOrEdgeTypes.d.ts +5 -4
- package/dist/esm/hooks/useNodeOrEdgeTypes.d.ts.map +1 -1
- package/dist/esm/hooks/useNodesEdgesState/index.d.ts +3 -5
- package/dist/esm/hooks/useNodesEdgesState/index.d.ts.map +1 -1
- package/dist/esm/hooks/useNodesEdgesState/type.d.ts +11 -13
- package/dist/esm/hooks/useNodesEdgesState/type.d.ts.map +1 -1
- package/dist/esm/hooks/useStore.d.ts +5 -4
- package/dist/esm/hooks/useStore.d.ts.map +1 -1
- package/dist/esm/index.js +83 -30
- package/dist/esm/index.mjs +83 -30
- package/dist/esm/store/index.d.ts +3 -1
- package/dist/esm/store/index.d.ts.map +1 -1
- package/dist/esm/types/core.d.ts +25 -23
- package/dist/esm/types/core.d.ts.map +1 -1
- package/dist/esm/utils/changes.d.ts +2 -2
- package/dist/esm/utils/changes.d.ts.map +1 -1
- package/dist/umd/components/Edges/BaseEdge.d.ts +4 -4
- package/dist/umd/components/Edges/BaseEdge.d.ts.map +1 -1
- package/dist/umd/components/Edges/BezierEdge.d.ts +5 -2
- package/dist/umd/components/Edges/BezierEdge.d.ts.map +1 -1
- package/dist/umd/components/Edges/EdgeWrapper/index.d.ts +4 -6
- package/dist/umd/components/Edges/EdgeWrapper/index.d.ts.map +1 -1
- package/dist/umd/components/Edges/EdgeWrapper/type.d.ts +12 -16
- package/dist/umd/components/Edges/EdgeWrapper/type.d.ts.map +1 -1
- package/dist/umd/components/Edges/StepEdge.d.ts +5 -2
- package/dist/umd/components/Edges/StepEdge.d.ts.map +1 -1
- package/dist/umd/components/Edges/StraightEdge.d.ts +6 -3
- package/dist/umd/components/Edges/StraightEdge.d.ts.map +1 -1
- package/dist/umd/components/Edges/type.d.ts +0 -3
- package/dist/umd/components/Edges/type.d.ts.map +1 -1
- package/dist/umd/components/Node/NodeWrapper/index.d.ts +3 -3
- package/dist/umd/components/Node/NodeWrapper/index.d.ts.map +1 -1
- package/dist/umd/components/Node/NodeWrapper/type.d.ts +8 -8
- package/dist/umd/components/Node/NodeWrapper/type.d.ts.map +1 -1
- package/dist/umd/components/Node/index.d.ts +2 -2
- package/dist/umd/components/Node/index.d.ts.map +1 -1
- package/dist/umd/components/Node/type.d.ts +1 -1
- package/dist/umd/components/Node/type.d.ts.map +1 -1
- package/dist/umd/components/Node/utils.d.ts +4 -4
- package/dist/umd/components/Node/utils.d.ts.map +1 -1
- package/dist/umd/components/ReactDiagramProvider/type.d.ts +19 -20
- package/dist/umd/components/ReactDiagramProvider/type.d.ts.map +1 -1
- package/dist/umd/components/StoreUpdater/index.d.ts +4 -2
- package/dist/umd/components/StoreUpdater/index.d.ts.map +1 -1
- package/dist/umd/container/ConnectionLineRenderer/ConnectionPath.d.ts +4 -4
- package/dist/umd/container/ConnectionLineRenderer/ConnectionPath.d.ts.map +1 -1
- package/dist/umd/container/ConnectionLineRenderer/index.d.ts +4 -3
- package/dist/umd/container/ConnectionLineRenderer/index.d.ts.map +1 -1
- package/dist/umd/container/EdgeRenderer/index.d.ts +7 -7
- package/dist/umd/container/EdgeRenderer/index.d.ts.map +1 -1
- package/dist/umd/container/EdgeRenderer/type.d.ts +4 -4
- package/dist/umd/container/EdgeRenderer/type.d.ts.map +1 -1
- package/dist/umd/container/EdgeRenderer/utils.d.ts +2 -1
- package/dist/umd/container/EdgeRenderer/utils.d.ts.map +1 -1
- package/dist/umd/container/NodeRenderer/index.d.ts +5 -6
- package/dist/umd/container/NodeRenderer/index.d.ts.map +1 -1
- package/dist/umd/container/NodeRenderer/type.d.ts +4 -4
- package/dist/umd/container/NodeRenderer/type.d.ts.map +1 -1
- package/dist/umd/container/NodeRenderer/utils.d.ts +2 -1
- package/dist/umd/container/NodeRenderer/utils.d.ts.map +1 -1
- package/dist/umd/container/Pane/index.d.ts.map +1 -1
- package/dist/umd/container/ReactDiagram/DiagramView.d.ts +7 -8
- package/dist/umd/container/ReactDiagram/DiagramView.d.ts.map +1 -1
- package/dist/umd/container/ReactDiagram/index.d.ts +8 -66
- package/dist/umd/container/ReactDiagram/index.d.ts.map +1 -1
- package/dist/umd/contexts/RCDStoreContext.d.ts +2 -2
- package/dist/umd/contexts/RCDStoreContext.d.ts.map +1 -1
- package/dist/umd/hooks/useNodeOrEdgeTypes.d.ts +5 -4
- package/dist/umd/hooks/useNodeOrEdgeTypes.d.ts.map +1 -1
- package/dist/umd/hooks/useNodesEdgesState/index.d.ts +3 -5
- package/dist/umd/hooks/useNodesEdgesState/index.d.ts.map +1 -1
- package/dist/umd/hooks/useNodesEdgesState/type.d.ts +11 -13
- package/dist/umd/hooks/useNodesEdgesState/type.d.ts.map +1 -1
- package/dist/umd/hooks/useStore.d.ts +5 -4
- package/dist/umd/hooks/useStore.d.ts.map +1 -1
- package/dist/umd/index.js +2 -2
- package/dist/umd/store/index.d.ts +3 -1
- package/dist/umd/store/index.d.ts.map +1 -1
- package/dist/umd/types/core.d.ts +25 -23
- package/dist/umd/types/core.d.ts.map +1 -1
- package/dist/umd/utils/changes.d.ts +2 -2
- package/dist/umd/utils/changes.d.ts.map +1 -1
- package/package.json +79 -79
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 taehunlim
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { EdgeProps } from './type';
|
|
1
|
+
import { Edge, EdgeProps } from './type';
|
|
2
2
|
import { EdgeLabelOptions } from './EdgeLabel';
|
|
3
|
-
|
|
3
|
+
type BaseEdgeProps<EdgeType extends Edge = Edge> = Pick<EdgeProps<EdgeType>, 'style' | 'markerStart' | 'markerEnd'> & EdgeLabelOptions & {
|
|
4
4
|
labelX?: number;
|
|
5
5
|
labelY?: number;
|
|
6
6
|
path: string;
|
|
7
|
-
}
|
|
8
|
-
declare function BaseEdge({ path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, }: BaseEdgeProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
};
|
|
8
|
+
declare function BaseEdge<EdgeType extends Edge = Edge>({ path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, }: BaseEdgeProps<EdgeType>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
declare namespace BaseEdge {
|
|
10
10
|
var displayName: string;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEdge.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Edges/BaseEdge.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"BaseEdge.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Edges/BaseEdge.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,KAAK,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CACpD,SAAS,CAAC,QAAQ,CAAC,EACnB,OAAO,GAAG,aAAa,GAAG,WAAW,CACvC,GACE,gBAAgB,GAAG;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACf,CAAC;AAEL,iBAAS,QAAQ,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC7C,IAAI,EACJ,MAAM,EACN,MAAM,EACN,KAAK,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,KAAK,EACL,SAAS,EACT,WAAW,GACb,EAAE,aAAa,CAAC,QAAQ,CAAC,2CAyBzB;kBAtCQ,QAAQ;;;AAyCjB,eAAe,QAAQ,CAAC"}
|
|
@@ -6,6 +6,9 @@ interface BezierPathOptions {
|
|
|
6
6
|
interface BezierEdgeProps<EdgeType extends Edge = Edge> extends EdgeProps<EdgeType> {
|
|
7
7
|
pathOptions?: BezierPathOptions;
|
|
8
8
|
}
|
|
9
|
-
declare const
|
|
10
|
-
|
|
9
|
+
declare const _default: import("react").MemoExoticComponent<{
|
|
10
|
+
<EdgeType extends Edge<Record<string, unknown>, string | undefined> = Edge<Record<string, unknown>, string | undefined>>({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, pathOptions, }: BezierEdgeProps<EdgeType>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
}>;
|
|
13
|
+
export default _default;
|
|
11
14
|
//# sourceMappingURL=BezierEdge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BezierEdge.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Edges/BezierEdge.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEzC,UAAU,iBAAiB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,eAAe,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,CACnD,SAAQ,SAAS,CAAC,QAAQ,CAAC;IAC3B,WAAW,CAAC,EAAE,iBAAiB,CAAC;CAClC
|
|
1
|
+
{"version":3,"file":"BezierEdge.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Edges/BezierEdge.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEzC,UAAU,iBAAiB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,eAAe,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,CACnD,SAAQ,SAAS,CAAC,QAAQ,CAAC;IAC3B,WAAW,CAAC,EAAE,iBAAiB,CAAC;CAClC;;;;;AAkDD,wBAAgC"}
|
|
@@ -2,11 +2,9 @@ import type { ComponentType, MouseEvent as ReactMouseEvent } from 'react';
|
|
|
2
2
|
import { StoreApi } from 'zustand';
|
|
3
3
|
import { ReactDiagramState } from '../../ReactDiagramProvider/type';
|
|
4
4
|
import { Edge, EdgeProps } from '../type';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
displayName: string;
|
|
10
|
-
}>;
|
|
5
|
+
import { EdgeWrapperProps } from '../EdgeWrapper/type';
|
|
6
|
+
import { Node } from '../../Node/type';
|
|
7
|
+
export declare function getMouseHandler<EdgeType extends Edge = Edge>(id: string, getState: StoreApi<ReactDiagramState<Node, EdgeType>>['getState'], handler?: (event: ReactMouseEvent<SVGGElement, MouseEvent>, edge: EdgeType) => void): ((event: ReactMouseEvent<SVGGElement, MouseEvent>) => void) | undefined;
|
|
8
|
+
declare const wrapEdge: <EdgeType extends Edge<Record<string, unknown>, string | undefined> = Edge<Record<string, unknown>, string | undefined>>(EdgeComponent: ComponentType<EdgeProps<EdgeType>>) => EdgeWrapperProps<EdgeType>;
|
|
11
9
|
export default wrapEdge;
|
|
12
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../react-diagram/packages/react/src/components/Edges/EdgeWrapper/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../react-diagram/packages/react/src/components/Edges/EdgeWrapper/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAiB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,wBAAgB,eAAe,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EACzD,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,EACjE,OAAO,CAAC,EAAE,CACP,KAAK,EAAE,eAAe,CAAC,WAAW,EAAE,UAAU,CAAC,EAC/C,IAAI,EAAE,QAAQ,KACZ,IAAI,YAII,gBAAgB,WAAW,EAAE,UAAU,CAAC,uBAOvD;AAED,QAAA,MAAM,QAAQ,2MA0Sb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { ComponentType, MemoExoticComponent, MouseEvent as ReactMouseEvent } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Connection, EdgePosition } from 'cosmos-diagram';
|
|
3
3
|
import { Edge } from '../type';
|
|
4
|
-
|
|
4
|
+
import { Node, ReactDiagramProps } from '../../../types';
|
|
5
|
+
import { ReactDiagramStore } from '../../ReactDiagramProvider/type';
|
|
6
|
+
export type EdgeMouseHandler<EdgeType extends Edge = Edge> = (event: ReactMouseEvent, edge: EdgeType) => void;
|
|
5
7
|
export type OnEdgeUpdateFunc<EdgeType extends Edge = Edge> = (originEdge: EdgeType, newConnection: Connection) => void;
|
|
6
|
-
export type WrapEdgeProps<
|
|
7
|
-
elementsSelectable?: boolean;
|
|
8
|
-
rfId?: string;
|
|
8
|
+
export type WrapEdgeProps<EdgeType extends Edge = Edge> = Edge & EdgePosition & Partial<Pick<ReactDiagramStore<Node, EdgeType>, 'rfId' | 'elementsSelectable'>> & Pick<ReactDiagramProps<Node, EdgeType>, 'edgeUpdaterRadius' | 'onEdgeUpdate' | 'onEdgeUpdateStart' | 'onEdgeUpdateEnd'> & {
|
|
9
9
|
isFocusable: boolean;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
onMouseLeave?: EdgeMouseHandler;
|
|
17
|
-
onEdgeUpdate?: OnEdgeUpdateFunc;
|
|
18
|
-
onEdgeUpdateStart?: (event: ReactMouseEvent, edge: Edge, portType: PortType) => void;
|
|
19
|
-
onEdgeUpdateEnd?: (event: MouseEvent | TouchEvent, edge: Edge, portType: PortType) => void;
|
|
10
|
+
onClick?: EdgeMouseHandler<EdgeType>;
|
|
11
|
+
onDoubleClick?: EdgeMouseHandler<EdgeType>;
|
|
12
|
+
onContextMenu?: EdgeMouseHandler<EdgeType>;
|
|
13
|
+
onMouseEnter?: EdgeMouseHandler<EdgeType>;
|
|
14
|
+
onMouseMove?: EdgeMouseHandler<EdgeType>;
|
|
15
|
+
onMouseLeave?: EdgeMouseHandler<EdgeType>;
|
|
20
16
|
};
|
|
21
|
-
export type EdgeWrapperProps = MemoExoticComponent<ComponentType<WrapEdgeProps
|
|
17
|
+
export type EdgeWrapperProps<EdgeType extends Edge = Edge> = MemoExoticComponent<ComponentType<WrapEdgeProps<EdgeType>>>;
|
|
22
18
|
//# sourceMappingURL=type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../react-diagram/packages/react/src/components/Edges/EdgeWrapper/type.ts"],"names":[],"mappings":"AAAA,OAAO,EACJ,aAAa,EACb,mBAAmB,EACnB,UAAU,IAAI,eAAe,EAC/B,MAAM,OAAO,CAAC;AAEf,OAAO,
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../react-diagram/packages/react/src/components/Edges/EdgeWrapper/type.ts"],"names":[],"mappings":"AAAA,OAAO,EACJ,aAAa,EACb,mBAAmB,EACnB,UAAU,IAAI,eAAe,EAC/B,MAAM,OAAO,CAAC;AAEf,OAAO,EAAG,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAC1D,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,QAAQ,KACZ,IAAI,CAAC;AAEV,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAC1D,UAAU,EAAE,QAAQ,EACpB,aAAa,EAAE,UAAU,KACvB,IAAI,CAAC;AA+BV,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,GAC3D,YAAY,GACZ,OAAO,CACJ,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,oBAAoB,CAAC,CACxE,GACD,IAAI,CACD,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,EAC/B,mBAAmB,GACnB,cAAc,GACd,mBAAmB,GACnB,iBAAiB,CACrB,GAAG;IACD,WAAW,EAAE,OAAO,CAAC;IAErB,OAAO,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,aAAa,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,WAAW,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;CAC5C,CAAC;AAEL,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IACtD,mBAAmB,CAAC,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -7,6 +7,9 @@ interface StepPathOptions {
|
|
|
7
7
|
interface StepEdgeProps<EdgeType extends Edge = Edge> extends EdgeProps<EdgeType> {
|
|
8
8
|
pathOptions?: StepPathOptions;
|
|
9
9
|
}
|
|
10
|
-
declare const
|
|
11
|
-
|
|
10
|
+
declare const _default: import("react").MemoExoticComponent<{
|
|
11
|
+
<EdgeType extends Edge<Record<string, unknown>, string | undefined> = Edge<Record<string, unknown>, string | undefined>>({ sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, sourcePosition, targetPosition, markerEnd, markerStart, pathOptions, }: StepEdgeProps<EdgeType>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
}>;
|
|
14
|
+
export default _default;
|
|
12
15
|
//# sourceMappingURL=StepEdge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepEdge.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Edges/StepEdge.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEzC,UAAU,eAAe;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,CACjD,SAAQ,SAAS,CAAC,QAAQ,CAAC;IAC3B,WAAW,CAAC,EAAE,eAAe,CAAC;CAChC
|
|
1
|
+
{"version":3,"file":"StepEdge.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Edges/StepEdge.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEzC,UAAU,eAAe;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,CACjD,SAAQ,SAAS,CAAC,QAAQ,CAAC;IAC3B,WAAW,CAAC,EAAE,eAAe,CAAC;CAChC;;;;;AAkDD,wBAA8B"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { EdgeProps } from '../../types';
|
|
3
|
-
declare const
|
|
4
|
-
|
|
2
|
+
import type { Edge, EdgeProps } from '../../types';
|
|
3
|
+
declare const _default: import("react").MemoExoticComponent<{
|
|
4
|
+
<EdgeType extends Edge<Record<string, unknown>, string | undefined> = Edge<Record<string, unknown>, string | undefined>>({ sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, }: EdgeProps<EdgeType>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
}>;
|
|
7
|
+
export default _default;
|
|
5
8
|
//# sourceMappingURL=StraightEdge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StraightEdge.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Edges/StraightEdge.tsx"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"StraightEdge.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Edges/StraightEdge.tsx"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;;;;;AA4CnD,wBAAkC"}
|
|
@@ -12,7 +12,4 @@ export type EdgeProps<EdgeType extends Edge = Edge> = Pick<EdgeType, 'id' | 'dat
|
|
|
12
12
|
markerEnd?: string;
|
|
13
13
|
pathOptions?: any;
|
|
14
14
|
};
|
|
15
|
-
export type EdgeComponentProps<PathOptions> = Pick<Edge, 'id' | 'markerStart' | 'markerEnd' | 'style' | 'sourcePort' | 'targetPort'> & EdgePosition & EdgeLabelOptions & {
|
|
16
|
-
pathOptions?: PathOptions;
|
|
17
|
-
};
|
|
18
15
|
//# sourceMappingURL=type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Edges/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,E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AAI,CAAC,CAAC;AAE9D,MAAM,MAAM,IAAI,CACb,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACvD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC7B,gBAAgB,GAAG;IAChB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEL,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CACvD,QAAQ,EACR,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAC5D,GACE,YAAY,GACZ,gBAAgB,GAAG;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,GAAG,CAAC;CACpB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import { XYPosition } from 'cosmos-diagram';
|
|
3
|
-
import { NodeProps } from '../type';
|
|
3
|
+
import { Node, NodeProps } from '../type';
|
|
4
4
|
import { NodeWrapperProps } from './type';
|
|
5
5
|
export declare const arrowKeyDiffs: Record<string, XYPosition>;
|
|
6
|
-
declare const wrapNode: (NodeComponent: ComponentType<NodeProps
|
|
7
|
-
({ id, type, data, positionX, positionY, sourcePosition, targetPosition, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, style, width, height, className, selected, isSelectable, isDraggable, intersected, hidden, resizeObserver, dragHandle, zIndex, isParent, initialized, disableKeyboardA11y, ariaLabel, rfId, noDragClassName, noPanClassName, }: NodeWrapperProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
declare const wrapNode: <NodeType extends Node<Record<string, unknown>, string> = Node<Record<string, unknown>, string>>(NodeComponent: ComponentType<NodeProps<NodeType>>) => import("react").MemoExoticComponent<{
|
|
7
|
+
({ id, type, data, positionX, positionY, sourcePosition, targetPosition, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, style, width, height, className, selected, isSelectable, isDraggable, intersected, hidden, resizeObserver, dragHandle, zIndex, isParent, initialized, disableKeyboardA11y, ariaLabel, rfId, noDragClassName, noPanClassName, }: NodeWrapperProps<NodeType>): import("react/jsx-runtime").JSX.Element | null;
|
|
8
8
|
displayName: string;
|
|
9
9
|
}>;
|
|
10
10
|
export default wrapNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../react-diagram/packages/react/src/components/Node/NodeWrapper/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,aAAa,EAAc,MAAM,OAAO,CAAC;AAYtE,OAAO,EAGJ,UAAU,EACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../react-diagram/packages/react/src/components/Node/NodeWrapper/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,aAAa,EAAc,MAAM,OAAO,CAAC;AAYtE,OAAO,EAGJ,UAAU,EACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAKpD,CAAC;AAEF,QAAA,MAAM,QAAQ;;;EA+Nb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { MouseEvent } from 'react';
|
|
2
2
|
import { Node } from '../type';
|
|
3
3
|
import { CoordinateExtent, NodeOrigin } from 'cosmos-diagram';
|
|
4
|
-
export type NodeMouseHandler = (event: MouseEvent, node:
|
|
5
|
-
export type NodeWrapperProps<
|
|
4
|
+
export type NodeMouseHandler<NodeType extends Node = Node> = (event: MouseEvent, node: NodeType) => void;
|
|
5
|
+
export type NodeWrapperProps<NodeType extends Node = Node> = Pick<Node, 'id' | 'data' | 'style' | 'className' | 'selected' | 'intersected' | 'dragHandle' | 'sourcePosition' | 'targetPosition' | 'hidden' | 'ariaLabel' | 'width' | 'height'> & Required<Pick<NodeType, 'type' | 'zIndex'>> & {
|
|
6
6
|
positionX: number;
|
|
7
7
|
positionY: number;
|
|
8
8
|
initialized: boolean;
|
|
9
9
|
isSelectable: boolean;
|
|
10
10
|
isDraggable: boolean;
|
|
11
|
-
onClick?: NodeMouseHandler
|
|
12
|
-
onDoubleClick?: NodeMouseHandler
|
|
13
|
-
onMouseEnter?: NodeMouseHandler
|
|
14
|
-
onMouseMove?: NodeMouseHandler
|
|
15
|
-
onMouseLeave?: NodeMouseHandler
|
|
16
|
-
onContextMenu?: NodeMouseHandler
|
|
11
|
+
onClick?: NodeMouseHandler<NodeType>;
|
|
12
|
+
onDoubleClick?: NodeMouseHandler<NodeType>;
|
|
13
|
+
onMouseEnter?: NodeMouseHandler<NodeType>;
|
|
14
|
+
onMouseMove?: NodeMouseHandler<NodeType>;
|
|
15
|
+
onMouseLeave?: NodeMouseHandler<NodeType>;
|
|
16
|
+
onContextMenu?: NodeMouseHandler<NodeType>;
|
|
17
17
|
resizeObserver: ResizeObserver | null;
|
|
18
18
|
isParent: boolean;
|
|
19
19
|
rfId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../react-diagram/packages/react/src/components/Node/NodeWrapper/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,M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C,WAAW,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,gBAAgB,CAAC;CAC/B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NodeProps } from './type';
|
|
2
|
-
declare function Nodes({ data }: NodeProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { Node, NodeProps } from './type';
|
|
2
|
+
declare function Nodes<NodeType extends Node = Node>({ data }: NodeProps<NodeType>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Nodes;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Node/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Node/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAIzC,iBAAS,KAAK,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,SAAS,CAAC,QAAQ,CAAC,2CAQzE;AACD,eAAe,KAAK,CAAC"}
|
|
@@ -5,7 +5,7 @@ export type Node<NodeData extends Record<string, unknown> = Record<string, unkno
|
|
|
5
5
|
style?: CSSProperties;
|
|
6
6
|
className?: string;
|
|
7
7
|
};
|
|
8
|
-
export type NodeProps<
|
|
8
|
+
export type NodeProps<NodeType extends Node = Node> = Pick<NodeWrapperProps<NodeType>, 'id' | 'data' | 'dragHandle' | 'type' | 'selected' | 'intersected' | 'positionX' | 'positionY' | 'zIndex' | 'width' | 'height'> & {
|
|
9
9
|
targetPosition?: Position;
|
|
10
10
|
sourcePosition?: Position;
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Node/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,MAAM,IAAI,CACb,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,MAAM,IAC/B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG;IAChC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Node/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,MAAM,IAAI,CACb,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,MAAM,IAC/B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG;IAChC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CACvD,gBAAgB,CAAC,QAAQ,CAAC,EACxB,IAAI,GACJ,MAAM,GACN,YAAY,GACZ,MAAM,GACN,UAAU,GACV,aAAa,GACb,WAAW,GACX,WAAW,GACX,QAAQ,GACR,OAAO,GACP,QAAQ,CACZ,GAAG;IACD,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,cAAc,CAAC,EAAE,QAAQ,CAAC;CAC5B,CAAC"}
|
|
@@ -2,12 +2,12 @@ import { MouseEvent, RefObject } from 'react';
|
|
|
2
2
|
import { StoreApi } from 'zustand';
|
|
3
3
|
import { ReactDiagramState } from '../../components/ReactDiagramProvider/type';
|
|
4
4
|
import { Node } from './type';
|
|
5
|
-
export declare function getMouseHandler(id: string, getState: StoreApi<ReactDiagramState
|
|
6
|
-
export declare function handleNodeClick({ id, store, isSelectable, unselect, nodeRef, }: {
|
|
5
|
+
export declare function getMouseHandler<NodeType extends Node = Node>(id: string, getState: StoreApi<ReactDiagramState<NodeType>>['getState'], handler?: (event: MouseEvent, node: NodeType) => void): ((event: MouseEvent) => void) | undefined;
|
|
6
|
+
export declare function handleNodeClick<NodeType extends Node = Node>({ id, store, isSelectable, unselect, nodeRef, }: {
|
|
7
7
|
id: string;
|
|
8
8
|
store: {
|
|
9
|
-
getState: StoreApi<ReactDiagramState
|
|
10
|
-
setState: StoreApi<ReactDiagramState
|
|
9
|
+
getState: StoreApi<ReactDiagramState<NodeType>>['getState'];
|
|
10
|
+
setState: StoreApi<ReactDiagramState<NodeType>>['setState'];
|
|
11
11
|
};
|
|
12
12
|
isSelectable?: boolean;
|
|
13
13
|
unselect?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Node/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAE/E,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/Node/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAE/E,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,wBAAgB,eAAe,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EACzD,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,EAC3D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,YAIxC,UAAU,uBAIzB;AAED,wBAAgB,eAAe,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC3D,EAAE,EACF,KAAK,EACL,YAAY,EACZ,QAAgB,EAChB,OAAO,GACT,EAAE;IACA,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE;QACJ,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QAC5D,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;KAC9D,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CACtC,QAoBA"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { MouseEvent as ReactMouseEvent } from 'react';
|
|
2
1
|
import { ZoomBehavior, Selection as D3Selection } from 'd3';
|
|
3
2
|
import type { Transform, CoordinateExtent, XYPosition, GridStep, OnConnectStart, OnConnect, OnConnectEnd, PanBy, NodeInternals, UpdateConnection, NodeDragItem, NodeOrigin, ConnectingPort } from 'cosmos-diagram';
|
|
4
3
|
import { Node, Edge, DefaultEdgeOptions, OnError } from '../../types';
|
|
5
4
|
import { NodeChange, OnNodesChange, OnEdgesChange, NodeDimensionUpdate } from '../../hooks/useNodesEdgesState/type';
|
|
6
|
-
export type NodeDragHandler = (event:
|
|
7
|
-
export type UnSelectNodesParams = {
|
|
8
|
-
nodes?:
|
|
5
|
+
export type NodeDragHandler<NodeType extends Node = Node> = (event: MouseEvent | TouchEvent, node: NodeType, nodes: NodeType[]) => void;
|
|
6
|
+
export type UnSelectNodesParams<NodeType extends Node = Node> = {
|
|
7
|
+
nodes?: NodeType[];
|
|
9
8
|
};
|
|
10
|
-
export type ReactDiagramStore = {
|
|
9
|
+
export type ReactDiagramStore<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
|
|
11
10
|
rfId: string;
|
|
12
11
|
width: number;
|
|
13
12
|
height: number;
|
|
14
13
|
transform: Transform;
|
|
15
|
-
nodeInternals: NodeInternals
|
|
16
|
-
edges:
|
|
14
|
+
nodeInternals: NodeInternals<NodeType>;
|
|
15
|
+
edges: EdgeType[];
|
|
17
16
|
defaultEdgeOptions?: DefaultEdgeOptions;
|
|
18
17
|
domNode: HTMLDivElement | null;
|
|
19
18
|
nodeOrigin: NodeOrigin;
|
|
@@ -30,11 +29,11 @@ export type ReactDiagramStore = {
|
|
|
30
29
|
minZoom: number;
|
|
31
30
|
maxZoom: number;
|
|
32
31
|
onError?: OnError;
|
|
33
|
-
onNodesChange: OnNodesChange | null;
|
|
34
|
-
onNodeDragStart?: NodeDragHandler
|
|
35
|
-
onNodeDrag?: NodeDragHandler
|
|
36
|
-
onNodeDragEnd?: NodeDragHandler
|
|
37
|
-
onEdgesChange?: OnEdgesChange
|
|
32
|
+
onNodesChange: OnNodesChange<NodeType> | null;
|
|
33
|
+
onNodeDragStart?: NodeDragHandler<NodeType>;
|
|
34
|
+
onNodeDrag?: NodeDragHandler<NodeType>;
|
|
35
|
+
onNodeDragEnd?: NodeDragHandler<NodeType>;
|
|
36
|
+
onEdgesChange?: OnEdgesChange<EdgeType>;
|
|
38
37
|
connectionPosition: XYPosition;
|
|
39
38
|
connectionStartPort: ConnectingPort | null;
|
|
40
39
|
connectionEndPort: ConnectingPort | null;
|
|
@@ -47,17 +46,17 @@ export type ReactDiagramStore = {
|
|
|
47
46
|
translateExtent: CoordinateExtent;
|
|
48
47
|
connectionRadius: number;
|
|
49
48
|
};
|
|
50
|
-
export type ReactDiagramActions = {
|
|
51
|
-
setNodes: (nodes:
|
|
52
|
-
getNodes: () =>
|
|
49
|
+
export type ReactDiagramActions<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
|
|
50
|
+
setNodes: (nodes: NodeType[]) => void;
|
|
51
|
+
getNodes: () => NodeType[];
|
|
53
52
|
addSelectedNodes: (nodeIds: string[]) => void;
|
|
54
|
-
unselectNodes: (params?: UnSelectNodesParams) => void;
|
|
53
|
+
unselectNodes: (params?: UnSelectNodesParams<NodeType>) => void;
|
|
55
54
|
resetSelectedElements: () => void;
|
|
56
|
-
setEdges: (edges:
|
|
55
|
+
setEdges: (edges: EdgeType[]) => void;
|
|
57
56
|
updateNodeDimensions: (updates: NodeDimensionUpdate[]) => void;
|
|
58
|
-
updateNodesPosition: (nodeDragItems: NodeDragItem[] |
|
|
57
|
+
updateNodesPosition: (nodeDragItems: NodeDragItem[] | NodeType[], dragging: boolean, updateFunc?: (node: NodeDragItem | NodeType) => void) => void;
|
|
59
58
|
updateNodesIntersection: () => void;
|
|
60
|
-
triggerNodeChanges: (changes: NodeChange[]) => void;
|
|
59
|
+
triggerNodeChanges: (changes: NodeChange<NodeType>[]) => void;
|
|
61
60
|
cancelConnection: () => void;
|
|
62
61
|
updateConnection: UpdateConnection;
|
|
63
62
|
panBy: PanBy;
|
|
@@ -66,5 +65,5 @@ export type ReactDiagramActions = {
|
|
|
66
65
|
setMinZoom: (minZoom: number) => void;
|
|
67
66
|
setMaxZoom: (minZoom: number) => void;
|
|
68
67
|
};
|
|
69
|
-
export type ReactDiagramState = ReactDiagramStore & ReactDiagramActions
|
|
68
|
+
export type ReactDiagramState<NodeType extends Node = Node, EdgeType extends Edge = Edge> = ReactDiagramStore<NodeType, EdgeType> & ReactDiagramActions<NodeType, EdgeType>;
|
|
70
69
|
//# sourceMappingURL=type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/ReactDiagramProvider/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/ReactDiagramProvider/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,IAAI,CAAC;AAE5D,OAAO,KAAK,EACT,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,cAAc,EACd,SAAS,EACT,YAAY,EACZ,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,cAAc,EAChB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ge } from '../../components/Edges/type';
|
|
3
|
+
import { Node } from '../../components/Node/type';
|
|
4
|
+
export type StoreUpdaterProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> = Pick<ReactDiagramProps<NodeType, EdgeType>, 'nodeOrigin' | 'nodes' | 'onNodesChange' | 'onNodeDrag' | 'onNodeDragStart' | 'onNodeDragEnd' | 'edges' | 'onEdgesChange' | 'smoothStep' | 'centerStep' | 'gridStep' | 'elevateNodesOnSelect' | 'nodesDraggable' | 'autoPanOnNodeDrag' | 'autoPanOnConnect' | 'onConnect' | 'onConnectStart' | 'onConnectEnd' | 'connectionRadius' | 'onError' | 'nodeExtent' | 'translateExtent' | 'minZoom' | 'maxZoom'> & {
|
|
3
5
|
rfId: string;
|
|
4
6
|
};
|
|
5
|
-
declare const StoreUpdater: ({ nodes, onNodesChange, onNodeDrag, onNodeDragStart, onNodeDragEnd, edges, onEdgesChange, nodeOrigin, smoothStep, centerStep, gridStep, elevateNodesOnSelect, nodesDraggable, autoPanOnNodeDrag, autoPanOnConnect, connectionRadius, onConnect, onConnectStart, onConnectEnd, onError, nodeExtent, translateExtent, minZoom, maxZoom, }: StoreUpdaterProps) => null;
|
|
7
|
+
declare const StoreUpdater: <NodeType extends Node<Record<string, unknown>, string> = Node<Record<string, unknown>, string>, EdgeType extends Edge<Record<string, unknown>, string | undefined> = Edge<Record<string, unknown>, string | undefined>>({ nodes, onNodesChange, onNodeDrag, onNodeDragStart, onNodeDragEnd, edges, onEdgesChange, nodeOrigin, smoothStep, centerStep, gridStep, elevateNodesOnSelect, nodesDraggable, autoPanOnNodeDrag, autoPanOnConnect, connectionRadius, onConnect, onConnectStart, onConnectEnd, onError, nodeExtent, translateExtent, minZoom, maxZoom, }: StoreUpdaterProps<NodeType, EdgeType>) => null;
|
|
6
8
|
export default StoreUpdater;
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/StoreUpdater/index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/StoreUpdater/index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAMlD,MAAM,MAAM,iBAAiB,CAC1B,QAAQ,SAAS,IAAI,GAAG,IAAI,EAC5B,QAAQ,SAAS,IAAI,GAAG,IAAI,IAC3B,IAAI,CACL,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACnC,YAAY,GACZ,OAAO,GACP,eAAe,GACf,YAAY,GACZ,iBAAiB,GACjB,eAAe,GACf,OAAO,GACP,eAAe,GACf,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,sBAAsB,GACtB,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,WAAW,GACX,gBAAgB,GAChB,cAAc,GACd,kBAAkB,GAClB,SAAS,GACT,YAAY,GACZ,iBAAiB,GACjB,SAAS,GACT,SAAS,CACb,GAAG;IACD,IAAI,EAAE,MAAM,CAAC;CACf,CAAC;AAgDF,QAAA,MAAM,YAAY,klBAkJjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { PortType } from 'cosmos-diagram';
|
|
2
2
|
import { Edge } from '../../types';
|
|
3
|
-
import { EdgeWrapperProps } from '../../components/Edges/EdgeWrapper/type';
|
|
4
3
|
import { ConnectionLineComponent } from './type';
|
|
5
|
-
|
|
4
|
+
import { EdgeWrapperProps } from '../../components/Edges/EdgeWrapper/type';
|
|
5
|
+
type ConnectionPathProps<EdgeType extends Edge = Edge> = {
|
|
6
6
|
nodeId: string;
|
|
7
7
|
portType: PortType;
|
|
8
8
|
edge?: Edge;
|
|
9
9
|
Component?: ConnectionLineComponent;
|
|
10
|
-
EdgeWrapper: EdgeWrapperProps
|
|
10
|
+
EdgeWrapper: EdgeWrapperProps<EdgeType>;
|
|
11
11
|
};
|
|
12
|
-
declare function ConnectionPath({ nodeId, portType, edge, Component, EdgeWrapper, }: ConnectionPathProps): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
declare function ConnectionPath<EdgeType extends Edge = Edge>({ nodeId, portType, edge, Component, EdgeWrapper, }: ConnectionPathProps<EdgeType>): import("react/jsx-runtime").JSX.Element | null;
|
|
13
13
|
declare namespace ConnectionPath {
|
|
14
14
|
var displayName: string;
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionPath.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/ConnectionLineRenderer/ConnectionPath.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAY,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ConnectionPath.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/ConnectionLineRenderer/ConnectionPath.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAY,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E,KAAK,mBAAmB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;CAC1C,CAAC;AASF,iBAAS,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EACnD,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,WAAW,GACb,EAAE,mBAAmB,CAAC,QAAQ,CAAC,kDAqF/B;kBA3FQ,cAAc;;;AA+FvB,eAAe,cAAc,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { ConnectionLineComponent } from './type';
|
|
3
3
|
import { EdgeTypesWrapped } from '../EdgeRenderer/type';
|
|
4
|
-
|
|
4
|
+
import { Edge } from '../../types';
|
|
5
|
+
type ConnectionLineRendererProps<EdgeType extends Edge = Edge> = {
|
|
5
6
|
containerStyle?: CSSProperties;
|
|
6
|
-
edgeTypes: EdgeTypesWrapped
|
|
7
|
+
edgeTypes: EdgeTypesWrapped<EdgeType>;
|
|
7
8
|
component?: ConnectionLineComponent;
|
|
8
9
|
};
|
|
9
|
-
declare function ConnectionLineRenderer({ containerStyle, edgeTypes, component, }: ConnectionLineRendererProps): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
declare function ConnectionLineRenderer<EdgeType extends Edge = Edge>({ containerStyle, edgeTypes, component, }: ConnectionLineRendererProps<EdgeType>): import("react/jsx-runtime").JSX.Element | null;
|
|
10
11
|
export default ConnectionLineRenderer;
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/ConnectionLineRenderer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/ConnectionLineRenderer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,KAAK,2BAA2B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IAC9D,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,SAAS,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,uBAAuB,CAAC;CACtC,CAAC;AAOF,iBAAS,sBAAsB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC3D,cAAc,EACd,SAAS,EACT,SAAS,GACX,EAAE,2BAA2B,CAAC,QAAQ,CAAC,kDAiCvC;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { Edge } from '../../components/Edges/type';
|
|
2
2
|
import { ReactDiagramState } from '../../components/ReactDiagramProvider/type';
|
|
3
|
-
import { ReactDiagramProps } from '../../types';
|
|
3
|
+
import { Node, ReactDiagramProps } from '../../types';
|
|
4
4
|
import { EdgeTypesWrapped } from './type';
|
|
5
|
-
type GraphViewEdgeProps = Pick<ReactDiagramState, 'rfId'> & Pick<ReactDiagramProps, 'edgeUpdaterRadius' | 'onEdgeClick' | 'onEdgeDoubleClick' | 'onEdgeContextMenu' | 'onEdgeMouseEnter' | 'onEdgeMouseMove' | 'onEdgeMouseLeave' | 'onEdgeUpdate' | 'onEdgeUpdateStart' | 'onEdgeUpdateEnd'>;
|
|
5
|
+
type GraphViewEdgeProps<EdgeType extends Edge = Edge> = Pick<ReactDiagramState<Node, EdgeType>, 'rfId'> & Pick<ReactDiagramProps<Node, EdgeType>, 'edgeUpdaterRadius' | 'onEdgeClick' | 'onEdgeDoubleClick' | 'onEdgeContextMenu' | 'onEdgeMouseEnter' | 'onEdgeMouseMove' | 'onEdgeMouseLeave' | 'onEdgeUpdate' | 'onEdgeUpdateStart' | 'onEdgeUpdateEnd'>;
|
|
6
6
|
type RequiredProps = Required<Pick<ReactDiagramProps, 'noPanClassName'>>;
|
|
7
|
-
type EdgeRendererProps = GraphViewEdgeProps & RequiredProps & {
|
|
8
|
-
edgeTypes: EdgeTypesWrapped
|
|
7
|
+
type EdgeRendererProps<EdgeType extends Edge = Edge> = GraphViewEdgeProps<EdgeType> & RequiredProps & {
|
|
8
|
+
edgeTypes: EdgeTypesWrapped<EdgeType>;
|
|
9
9
|
};
|
|
10
|
-
declare function EdgeRenderer({ rfId, edgeTypes, noPanClassName, edgeUpdaterRadius, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd, }: EdgeRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function EdgeRenderer<EdgeType extends Edge = Edge>({ rfId, edgeTypes, noPanClassName, edgeUpdaterRadius, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd, }: EdgeRendererProps<EdgeType>): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
declare namespace EdgeRenderer {
|
|
12
12
|
var displayName: string;
|
|
13
13
|
}
|
|
14
|
-
declare const _default:
|
|
14
|
+
declare const _default: typeof EdgeRenderer;
|
|
15
15
|
export default _default;
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/EdgeRenderer/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/EdgeRenderer/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,KAAK,kBAAkB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CACzD,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,EACjC,MAAM,CACR,GACE,IAAI,CACD,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,EAC/B,mBAAmB,GACnB,aAAa,GACb,mBAAmB,GACnB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,iBAAiB,CACrB,CAAC;AAEL,KAAK,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEzE,KAAK,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAChD,kBAAkB,CAAC,QAAQ,CAAC,GACzB,aAAa,GAAG;IACb,SAAS,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;CACxC,CAAC;AAUR,iBAAS,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EACjD,IAAI,EACJ,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,eAAe,GACjB,EAAE,iBAAiB,CAAC,QAAQ,CAAC,2CA8I7B;kBA5JQ,YAAY;;;;AAgKrB,wBAAyD"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { EdgeProps } from '../../components/Edges/type';
|
|
2
|
+
import { Edge, EdgeProps } from '../../components/Edges/type';
|
|
3
3
|
import { EdgeWrapperProps } from '../../components/Edges/EdgeWrapper/type';
|
|
4
|
-
export type EdgeTypes = Record<string, ComponentType<EdgeProps & {
|
|
5
|
-
data
|
|
4
|
+
export type EdgeTypes<EdgeType extends Edge = Edge> = Record<string, ComponentType<EdgeProps<EdgeType> & {
|
|
5
|
+
data?: any;
|
|
6
6
|
type: any;
|
|
7
7
|
}>>;
|
|
8
|
-
export type EdgeTypesWrapped = Record<string, EdgeWrapperProps
|
|
8
|
+
export type EdgeTypesWrapped<EdgeType extends Edge = Edge> = Record<string, EdgeWrapperProps<EdgeType>>;
|
|
9
9
|
//# sourceMappingURL=type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/EdgeRenderer/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/EdgeRenderer/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,MAAM,CACzD,MAAM,EACN,aAAa,CACV,SAAS,CAAC,QAAQ,CAAC,GAAG;IAEnB,IAAI,CAAC,EAAE,GAAG,CAAC;IAEX,IAAI,EAAE,GAAG,CAAC;CACZ,CACH,CACH,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,MAAM,CAChE,MAAM,EACN,gBAAgB,CAAC,QAAQ,CAAC,CAC5B,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { PortElement, NodePortBounds } from 'cosmos-diagram';
|
|
2
2
|
import { Rect, Transform, Position, XYPosition } from 'cosmos-diagram';
|
|
3
3
|
import { Node } from '../../components/Node/type';
|
|
4
|
+
import { Edge } from '../../components/Edges/type';
|
|
4
5
|
import { EdgeTypes, EdgeTypesWrapped } from './type';
|
|
5
|
-
export declare const createEdgeTypes: (edgeTypes: EdgeTypes) => EdgeTypesWrapped
|
|
6
|
+
export declare const createEdgeTypes: <EdgeType extends Edge<Record<string, unknown>, string | undefined> = Edge<Record<string, unknown>, string | undefined>>(edgeTypes: EdgeTypes<EdgeType>) => EdgeTypesWrapped<EdgeType>;
|
|
6
7
|
export declare function getPortPosition(position: Position, nodeRect: Rect, port?: PortElement | null): XYPosition;
|
|
7
8
|
export declare function getPort(bounds: PortElement[], portId?: string | null): PortElement | null;
|
|
8
9
|
interface EdgePositions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/EdgeRenderer/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAQlE,OAAO,EAEJ,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,UAAU,EACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/EdgeRenderer/utils.ts"],"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