@likec4/diagram 1.0.0-next.2 → 1.0.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/dist/LikeC4Diagram.css.d.ts +0 -1
- package/dist/LikeC4Diagram.d.ts +1 -2
- package/dist/LikeC4Diagram.props.d.ts +24 -25
- package/dist/StaticLikeC4Diagram.d.ts +1 -2
- package/dist/globals.css.d.ts +1 -0
- package/dist/hooks/index.d.ts +2 -3
- package/dist/hooks/useSetState.d.ts +3 -0
- package/dist/hooks/useUpdateEffect.d.ts +4 -0
- package/dist/icons/Clipboard.d.ts +0 -1
- package/dist/icons/Link.d.ts +0 -1
- package/dist/icons/ZoomIn.d.ts +0 -1
- package/dist/icons/index.d.ts +0 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.mjs +9388 -0
- package/dist/mantine/EnsureMantine.d.ts +2 -4
- package/dist/mantine/theme.d.ts +3 -0
- package/dist/mantine.css.d.ts +1 -0
- package/dist/state/DiagramContext.d.ts +386 -0
- package/dist/state/WhenInitialized.d.ts +3 -0
- package/dist/state/diagramStore.d.ts +428 -0
- package/dist/state/index.d.ts +4 -2
- package/dist/state/useDiagramStore.d.ts +387 -0
- package/dist/style.css +1212 -1
- package/dist/theme.css.d.ts +16 -2
- package/dist/ui/Camera.d.ts +0 -1
- package/dist/ui/KeepAspectRatio.css.d.ts +0 -1
- package/dist/ui/KeepAspectRatio.d.ts +0 -1
- package/dist/ui/OptionsPanel.css.d.ts +0 -1
- package/dist/ui/OptionsPanel.d.ts +0 -1
- package/dist/ui/index.d.ts +0 -1
- package/dist/ui/options/NodeOptions.d.ts +0 -1
- package/dist/xyflow/FitviewOnDiagramChange.d.ts +1 -5
- package/dist/xyflow/SyncWithDiagram.d.ts +5 -0
- package/dist/xyflow/XYFlowBackground.d.ts +0 -1
- package/dist/xyflow/XYFlowEvents.d.ts +5 -15
- package/dist/xyflow/XYFlowWrapper.d.ts +4 -5
- package/dist/xyflow/const.d.ts +1 -2
- package/dist/xyflow/diagram-to-xyflow.d.ts +4 -2
- package/dist/xyflow/edges/RelationshipEdge.d.ts +7 -7
- package/dist/xyflow/edges/edges.css.d.ts +2 -1
- package/dist/xyflow/edges/utils.d.ts +3 -4
- package/dist/xyflow/hooks/index.d.ts +2 -37
- package/dist/xyflow/hooks/{use-layout-/321/201onstraints.d.ts → useLayoutConstraints.d.ts} +2 -4
- package/dist/xyflow/hooks/useXYFlow.d.ts +266 -0
- package/dist/xyflow/nodes/compound/CompoundNode.css.d.ts +0 -1
- package/dist/xyflow/nodes/compound/CompoundNode.d.ts +0 -1
- package/dist/xyflow/nodes/compound/index.d.ts +0 -1
- package/dist/xyflow/nodes/element/ElementIcon.d.ts +1 -2
- package/dist/xyflow/nodes/element/ElementLink.css.d.ts +0 -1
- package/dist/xyflow/nodes/element/ElementLink.d.ts +1 -2
- package/dist/xyflow/nodes/element/ElementNode.d.ts +1 -3
- package/dist/xyflow/nodes/element/ElementShapeSvg.d.ts +2 -3
- package/dist/xyflow/nodes/element/element.css.d.ts +0 -1
- package/dist/xyflow/nodes/element/index.d.ts +1 -2
- package/dist/xyflow/nodes/shared/NavigateToBtn.d.ts +0 -1
- package/dist/xyflow/types.d.ts +20 -8
- package/dist/xyflow/utils.d.ts +0 -1
- package/package.json +36 -34
- package/src/LikeC4Diagram.css.ts +31 -0
- package/src/LikeC4Diagram.props.ts +154 -0
- package/src/LikeC4Diagram.tsx +119 -0
- package/src/StaticLikeC4Diagram.tsx +39 -0
- package/src/globals.css.ts +128 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useSetState.ts +19 -0
- package/src/hooks/useUpdateEffect.ts +28 -0
- package/src/icons/Clipboard.tsx +24 -0
- package/src/icons/Link.tsx +23 -0
- package/src/icons/ZoomIn.tsx +25 -0
- package/src/icons/index.ts +3 -0
- package/src/index.ts +11 -0
- package/src/mantine/EnsureMantine.tsx +14 -0
- package/src/mantine/theme.ts +19 -0
- package/src/mantine.css.ts +4 -0
- package/src/reset.d.ts +2 -0
- package/src/state/DiagramContext.tsx +42 -0
- package/src/state/WhenInitialized.tsx +24 -0
- package/src/state/diagramStore.ts +358 -0
- package/src/state/index.ts +4 -0
- package/src/state/useDiagramStore.ts +39 -0
- package/src/theme.css.ts +64 -0
- package/src/ui/Camera.tsx +174 -0
- package/src/ui/KeepAspectRatio.css.ts +7 -0
- package/src/ui/KeepAspectRatio.tsx +35 -0
- package/src/ui/OptionsPanel.css.ts +10 -0
- package/src/ui/OptionsPanel.tsx +65 -0
- package/src/ui/index.ts +3 -0
- package/src/ui/options/NodeOptions.tsx +253 -0
- package/src/xyflow/FitviewOnDiagramChange.tsx +93 -0
- package/src/xyflow/SyncWithDiagram.tsx +113 -0
- package/src/xyflow/XYFlowBackground.tsx +33 -0
- package/src/xyflow/XYFlowEvents.tsx +100 -0
- package/src/xyflow/XYFlowWrapper.tsx +166 -0
- package/src/xyflow/const.ts +7 -0
- package/src/xyflow/diagram-to-xyflow.ts +197 -0
- package/src/xyflow/edges/RelationshipEdge.tsx +288 -0
- package/src/xyflow/edges/edges.css.ts +124 -0
- package/src/xyflow/edges/utils.ts +110 -0
- package/src/xyflow/hooks/index.ts +2 -0
- package/src/xyflow/hooks/useLayoutConstraints.ts +289 -0
- package/src/xyflow/hooks/useXYFlow.ts +20 -0
- package/src/xyflow/nodes/compound/CompoundNode.css.ts +191 -0
- package/src/xyflow/nodes/compound/CompoundNode.tsx +105 -0
- package/src/xyflow/nodes/compound/index.ts +1 -0
- package/src/xyflow/nodes/element/ElementIcon.tsx +44 -0
- package/src/xyflow/nodes/element/ElementLink.css.ts +67 -0
- package/src/xyflow/nodes/element/ElementLink.tsx +94 -0
- package/src/xyflow/nodes/element/ElementNode.tsx +225 -0
- package/src/xyflow/nodes/element/ElementShapeSvg.tsx +181 -0
- package/src/xyflow/nodes/element/element.css.ts +261 -0
- package/src/xyflow/nodes/element/index.ts +1 -0
- package/src/xyflow/nodes/shared/NavigateToBtn.tsx +25 -0
- package/src/xyflow/types.ts +100 -0
- package/src/xyflow/utils.ts +12 -0
- package/dist/EmbeddedLikeC4Diagram.css.d.ts +0 -6
- package/dist/EmbeddedLikeC4Diagram.d.ts +0 -18
- package/dist/bundle.d.ts +0 -3
- package/dist/hooks/use-set-state.d.ts +0 -2
- package/dist/hooks/use-update-effect.d.ts +0 -4
- package/dist/index.css.d.ts +0 -2
- package/dist/index.js +0 -13043
- package/dist/mantine/index.d.ts +0 -3
- package/dist/state/DiagramState.d.ts +0 -162
- package/dist/xyflow/UpdateOnDiagramChange.d.ts +0 -10
package/dist/theme.css.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
export declare const vars: {
|
|
2
|
+
default: {
|
|
3
|
+
font: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
4
|
+
};
|
|
2
5
|
likec4: {
|
|
3
6
|
font: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
4
|
-
|
|
7
|
+
background: {
|
|
8
|
+
color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
9
|
+
pattern: {
|
|
10
|
+
color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
5
13
|
};
|
|
6
14
|
compound: {
|
|
7
15
|
font: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
@@ -19,10 +27,17 @@ export declare const vars: {
|
|
|
19
27
|
labelColor: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
20
28
|
labelBgColor: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
21
29
|
};
|
|
30
|
+
optionsPanel: {
|
|
31
|
+
top: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
32
|
+
right: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
33
|
+
};
|
|
22
34
|
};
|
|
23
35
|
export declare const xyvars: {
|
|
24
36
|
background: {
|
|
25
37
|
color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
38
|
+
pattern: {
|
|
39
|
+
color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
40
|
+
};
|
|
26
41
|
};
|
|
27
42
|
edge: {
|
|
28
43
|
stroke: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
@@ -41,4 +56,3 @@ export declare const xyvars: {
|
|
|
41
56
|
borderRadius: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
42
57
|
};
|
|
43
58
|
};
|
|
44
|
-
//# sourceMappingURL=theme.css.d.ts.map
|
package/dist/ui/Camera.d.ts
CHANGED
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
* Fits the view when the view changes and nodes are initialized
|
|
4
|
-
*/
|
|
5
|
-
export declare const FitviewOnDiagramChange: import('react').NamedExoticComponent<object>;
|
|
6
|
-
//# sourceMappingURL=FitviewOnDiagramChange.d.ts.map
|
|
2
|
+
export declare const FitViewOnDiagramChange: import('react').MemoExoticComponent<() => JSX.Element | null>;
|
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
import { XYFlowEdge, XYFlowNode } from './types';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { EdgeMouseHandler, NodeMouseHandler } from '@xyflow/react';
|
|
2
|
+
import { MouseEvent as ReactMouseEvent } from 'react';
|
|
3
|
+
import { EdgeMouseHandler, NodeMouseHandler, OnMoveEnd } from '@xyflow/react';
|
|
5
4
|
|
|
6
5
|
type XYFlowEventHandlers = {
|
|
7
|
-
|
|
8
|
-
onPanelClick: (event: React.MouseEvent) => void;
|
|
6
|
+
onPaneClick: (event: ReactMouseEvent) => void;
|
|
9
7
|
onNodeContextMenu: NodeMouseHandler<XYFlowNode>;
|
|
10
8
|
onEdgeContextMenu: EdgeMouseHandler<XYFlowEdge>;
|
|
11
|
-
onPaneContextMenu: (event:
|
|
9
|
+
onPaneContextMenu: (event: ReactMouseEvent | MouseEvent) => void;
|
|
12
10
|
onNodeClick: NodeMouseHandler<XYFlowNode>;
|
|
13
11
|
onEdgeClick: EdgeMouseHandler<XYFlowEdge>;
|
|
14
|
-
|
|
12
|
+
onMoveEnd: OnMoveEnd;
|
|
15
13
|
};
|
|
16
14
|
export declare function useXYFlowEvents(): XYFlowEventHandlers;
|
|
17
|
-
type Props = PropsWithChildren<{
|
|
18
|
-
eventHandlers: LikeC4DiagramEventHandlers;
|
|
19
|
-
}>;
|
|
20
|
-
/**
|
|
21
|
-
* Bridge between ReactFlow and LikeC4Diagram event handlers
|
|
22
|
-
*/
|
|
23
|
-
export declare function XYFlowEventHandlers({ children, eventHandlers }: Props): JSX.Element;
|
|
24
15
|
export {};
|
|
25
|
-
//# sourceMappingURL=XYFlowEvents.d.ts.map
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { XYFlowEdge, XYFlowNode } from './types';
|
|
2
2
|
import { LikeC4DiagramProperties } from '../LikeC4Diagram.props';
|
|
3
|
-
import { Simplify } from 'type-fest';
|
|
3
|
+
import { SetNonNullable, Simplify } from 'type-fest';
|
|
4
4
|
import { CSSProperties, PropsWithChildren } from 'react';
|
|
5
5
|
|
|
6
|
-
type OnlyExpectedProps = Required<
|
|
7
|
-
type XYFlowWrapperProps = Simplify<PropsWithChildren<OnlyExpectedProps & {
|
|
6
|
+
type OnlyExpectedProps = Required<Pick<LikeC4DiagramProperties, 'className' | 'controls' | 'pannable' | 'zoomable' | 'background'>>;
|
|
7
|
+
type XYFlowWrapperProps = Simplify<PropsWithChildren<SetNonNullable<OnlyExpectedProps> & {
|
|
8
8
|
defaultNodes: XYFlowNode[];
|
|
9
9
|
defaultEdges: XYFlowEdge[];
|
|
10
10
|
style?: CSSProperties | undefined;
|
|
11
11
|
}>>;
|
|
12
|
-
declare function XYFlowWrapper({ className, children, defaultNodes, defaultEdges,
|
|
12
|
+
declare function XYFlowWrapper({ className, children, defaultNodes, defaultEdges, pannable, zoomable, controls, background, style }: XYFlowWrapperProps): JSX.Element;
|
|
13
13
|
export declare const XYFlow: typeof XYFlowWrapper;
|
|
14
14
|
export {};
|
|
15
|
-
//# sourceMappingURL=XYFlowWrapper.d.ts.map
|
package/dist/xyflow/const.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { XYFlowData } from '../xyflow/types';
|
|
2
2
|
import { DiagramView } from '@likec4/core';
|
|
3
3
|
|
|
4
|
-
export declare function diagramViewToXYFlowData(view: Pick<DiagramView, 'nodes' | 'edges'>,
|
|
5
|
-
|
|
4
|
+
export declare function diagramViewToXYFlowData(view: Pick<DiagramView, 'nodes' | 'edges'>, opts: {
|
|
5
|
+
draggable: boolean;
|
|
6
|
+
selectable: boolean;
|
|
7
|
+
}): XYFlowData;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
1
2
|
import { EdgeProps } from '@xyflow/react';
|
|
2
3
|
|
|
3
4
|
export declare const RelationshipEdge: import('react').NamedExoticComponent<EdgeProps<{
|
|
4
5
|
source: string;
|
|
5
6
|
target: string;
|
|
6
|
-
style?:
|
|
7
|
+
style?: CSSProperties;
|
|
7
8
|
id: string;
|
|
9
|
+
zIndex?: number;
|
|
10
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
11
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
8
12
|
hidden?: boolean;
|
|
9
13
|
selected?: boolean;
|
|
10
14
|
selectable?: boolean;
|
|
11
15
|
deletable?: boolean;
|
|
12
|
-
zIndex?: number;
|
|
13
16
|
ariaLabel?: string;
|
|
14
17
|
className?: string;
|
|
15
18
|
focusable?: boolean;
|
|
@@ -17,16 +20,13 @@ export declare const RelationshipEdge: import('react').NamedExoticComponent<Edge
|
|
|
17
20
|
sourceHandle?: string | null;
|
|
18
21
|
targetHandle?: string | null;
|
|
19
22
|
animated?: boolean;
|
|
20
|
-
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
21
|
-
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
22
23
|
interactionWidth?: number;
|
|
23
|
-
labelStyle?:
|
|
24
|
+
labelStyle?: CSSProperties;
|
|
24
25
|
labelShowBg?: boolean;
|
|
25
|
-
labelBgStyle?:
|
|
26
|
+
labelBgStyle?: CSSProperties;
|
|
26
27
|
labelBgPadding?: [number, number];
|
|
27
28
|
labelBgBorderRadius?: number;
|
|
28
29
|
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
29
30
|
data: import("../types").RelationshipData;
|
|
30
31
|
type: "relationship";
|
|
31
32
|
}>>;
|
|
32
|
-
//# sourceMappingURL=RelationshipEdge.d.ts.map
|
|
@@ -2,6 +2,7 @@ export declare const container: string;
|
|
|
2
2
|
export declare const edgePathBg: string;
|
|
3
3
|
export declare const fillStrokeCtx: string;
|
|
4
4
|
export declare const cssEdgePath: string;
|
|
5
|
+
export declare const varLabelX: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
6
|
+
export declare const varLabelY: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
5
7
|
export declare const edgeLabel: string;
|
|
6
8
|
export declare const edgeLabelBody: string;
|
|
7
|
-
//# sourceMappingURL=edges.css.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InternalXYFlowNode } from '../types';
|
|
2
2
|
import { Position, XYPosition } from '@xyflow/react';
|
|
3
3
|
|
|
4
|
-
export declare function getPointPosition(node:
|
|
5
|
-
export declare function getEdgeParams(source:
|
|
4
|
+
export declare function getPointPosition(node: InternalXYFlowNode, intersectionPoint: XYPosition): readonly [number, number, Position];
|
|
5
|
+
export declare function getEdgeParams(source: InternalXYFlowNode, target: InternalXYFlowNode): {
|
|
6
6
|
sx: number;
|
|
7
7
|
sy: number;
|
|
8
8
|
tx: number;
|
|
@@ -10,4 +10,3 @@ export declare function getEdgeParams(source: XYFlowNode, target: XYFlowNode): {
|
|
|
10
10
|
sourcePos: Position;
|
|
11
11
|
targetPos: Position;
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1,37 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const useXYFlow: () => import('@xyflow/react').ReactFlowInstance<XYFlowNode, {
|
|
4
|
-
source: string;
|
|
5
|
-
target: string;
|
|
6
|
-
style?: import("react").CSSProperties;
|
|
7
|
-
id: string;
|
|
8
|
-
hidden?: boolean;
|
|
9
|
-
selected?: boolean;
|
|
10
|
-
selectable?: boolean;
|
|
11
|
-
deletable?: boolean;
|
|
12
|
-
zIndex?: number;
|
|
13
|
-
ariaLabel?: string;
|
|
14
|
-
className?: string;
|
|
15
|
-
focusable?: boolean;
|
|
16
|
-
label?: import("react").ReactNode;
|
|
17
|
-
sourceHandle?: string | null;
|
|
18
|
-
targetHandle?: string | null;
|
|
19
|
-
animated?: boolean;
|
|
20
|
-
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
21
|
-
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
22
|
-
interactionWidth?: number;
|
|
23
|
-
labelStyle?: import("react").CSSProperties;
|
|
24
|
-
labelShowBg?: boolean;
|
|
25
|
-
labelBgStyle?: import("react").CSSProperties;
|
|
26
|
-
labelBgPadding?: [number, number];
|
|
27
|
-
labelBgBorderRadius?: number;
|
|
28
|
-
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
29
|
-
data: import("../types").RelationshipData;
|
|
30
|
-
type: "relationship";
|
|
31
|
-
}>;
|
|
32
|
-
export declare const useXYNodesData: {
|
|
33
|
-
(nodeId: string): Pick<XYFlowNode, "id" | "type" | "data"> | null;
|
|
34
|
-
(nodeIds: string[]): Pick<XYFlowNode, "id" | "type" | "data">[];
|
|
35
|
-
};
|
|
36
|
-
export { useLayoutConstraints } from './use-layout-сonstraints';
|
|
37
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export * from './useLayoutConstraints';
|
|
2
|
+
export * from './useXYFlow';
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RefObject } from 'react';
|
|
1
|
+
import { XYFlowNode } from '../types';
|
|
3
2
|
import { ReactFlowProps } from '@xyflow/react';
|
|
4
3
|
|
|
5
4
|
type LayoutConstraints = Required<Pick<ReactFlowProps<XYFlowNode>, 'onNodeDragStart' | 'onNodeDrag' | 'onNodeDragStop'>>;
|
|
6
5
|
/**
|
|
7
6
|
* Keeps the layout constraints (parent nodes and children) when dragging a node
|
|
8
7
|
*/
|
|
9
|
-
export declare function useLayoutConstraints(
|
|
8
|
+
export declare function useLayoutConstraints(): LayoutConstraints;
|
|
10
9
|
export {};
|
|
11
|
-
//# sourceMappingURL=use-layout-%D1%81onstraints.d.ts.map
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { XYFlowNode, XYFlowState } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare const useXYFlow: () => import('@xyflow/react').ReactFlowInstance<XYFlowNode, {
|
|
4
|
+
source: string;
|
|
5
|
+
target: string;
|
|
6
|
+
style?: import("react").CSSProperties;
|
|
7
|
+
id: string;
|
|
8
|
+
zIndex?: number;
|
|
9
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
10
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
11
|
+
hidden?: boolean;
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
selectable?: boolean;
|
|
14
|
+
deletable?: boolean;
|
|
15
|
+
ariaLabel?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
focusable?: boolean;
|
|
18
|
+
label?: import("react").ReactNode;
|
|
19
|
+
sourceHandle?: string | null;
|
|
20
|
+
targetHandle?: string | null;
|
|
21
|
+
animated?: boolean;
|
|
22
|
+
interactionWidth?: number;
|
|
23
|
+
labelStyle?: import("react").CSSProperties;
|
|
24
|
+
labelShowBg?: boolean;
|
|
25
|
+
labelBgStyle?: import("react").CSSProperties;
|
|
26
|
+
labelBgPadding?: [number, number];
|
|
27
|
+
labelBgBorderRadius?: number;
|
|
28
|
+
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
29
|
+
data: import("../types").RelationshipData;
|
|
30
|
+
type: "relationship";
|
|
31
|
+
}>;
|
|
32
|
+
export declare const useXYNodesData: {
|
|
33
|
+
(nodeId: string): Pick<XYFlowNode, "id" | "type" | "data"> | null;
|
|
34
|
+
(nodeIds: string[]): Pick<XYFlowNode, "id" | "type" | "data">[];
|
|
35
|
+
};
|
|
36
|
+
export declare function useXYStore<StateSlice = unknown>(selector: (state: XYFlowState) => StateSlice, equalityFn?: (a: StateSlice, b: StateSlice) => boolean): StateSlice;
|
|
37
|
+
export declare const useXYStoreApi: () => {
|
|
38
|
+
getState: () => import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
39
|
+
source: string;
|
|
40
|
+
target: string;
|
|
41
|
+
style?: import("react").CSSProperties;
|
|
42
|
+
id: string;
|
|
43
|
+
zIndex?: number;
|
|
44
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
45
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
46
|
+
hidden?: boolean;
|
|
47
|
+
selected?: boolean;
|
|
48
|
+
selectable?: boolean;
|
|
49
|
+
deletable?: boolean;
|
|
50
|
+
ariaLabel?: string;
|
|
51
|
+
className?: string;
|
|
52
|
+
focusable?: boolean;
|
|
53
|
+
label?: import("react").ReactNode;
|
|
54
|
+
sourceHandle?: string | null;
|
|
55
|
+
targetHandle?: string | null;
|
|
56
|
+
animated?: boolean;
|
|
57
|
+
interactionWidth?: number;
|
|
58
|
+
labelStyle?: import("react").CSSProperties;
|
|
59
|
+
labelShowBg?: boolean;
|
|
60
|
+
labelBgStyle?: import("react").CSSProperties;
|
|
61
|
+
labelBgPadding?: [number, number];
|
|
62
|
+
labelBgBorderRadius?: number;
|
|
63
|
+
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
64
|
+
data: import("../types").RelationshipData;
|
|
65
|
+
type: "relationship";
|
|
66
|
+
}>;
|
|
67
|
+
setState: (partial: import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
68
|
+
source: string;
|
|
69
|
+
target: string;
|
|
70
|
+
style?: import("react").CSSProperties;
|
|
71
|
+
id: string;
|
|
72
|
+
zIndex?: number;
|
|
73
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
74
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
75
|
+
hidden?: boolean;
|
|
76
|
+
selected?: boolean;
|
|
77
|
+
selectable?: boolean;
|
|
78
|
+
deletable?: boolean;
|
|
79
|
+
ariaLabel?: string;
|
|
80
|
+
className?: string;
|
|
81
|
+
focusable?: boolean;
|
|
82
|
+
label?: import("react").ReactNode;
|
|
83
|
+
sourceHandle?: string | null;
|
|
84
|
+
targetHandle?: string | null;
|
|
85
|
+
animated?: boolean;
|
|
86
|
+
interactionWidth?: number;
|
|
87
|
+
labelStyle?: import("react").CSSProperties;
|
|
88
|
+
labelShowBg?: boolean;
|
|
89
|
+
labelBgStyle?: import("react").CSSProperties;
|
|
90
|
+
labelBgPadding?: [number, number];
|
|
91
|
+
labelBgBorderRadius?: number;
|
|
92
|
+
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
93
|
+
data: import("../types").RelationshipData;
|
|
94
|
+
type: "relationship";
|
|
95
|
+
}> | Partial<import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
96
|
+
source: string;
|
|
97
|
+
target: string;
|
|
98
|
+
style?: import("react").CSSProperties;
|
|
99
|
+
id: string;
|
|
100
|
+
zIndex?: number;
|
|
101
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
102
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
103
|
+
hidden?: boolean;
|
|
104
|
+
selected?: boolean;
|
|
105
|
+
selectable?: boolean;
|
|
106
|
+
deletable?: boolean;
|
|
107
|
+
ariaLabel?: string;
|
|
108
|
+
className?: string;
|
|
109
|
+
focusable?: boolean;
|
|
110
|
+
label?: import("react").ReactNode;
|
|
111
|
+
sourceHandle?: string | null;
|
|
112
|
+
targetHandle?: string | null;
|
|
113
|
+
animated?: boolean;
|
|
114
|
+
interactionWidth?: number;
|
|
115
|
+
labelStyle?: import("react").CSSProperties;
|
|
116
|
+
labelShowBg?: boolean;
|
|
117
|
+
labelBgStyle?: import("react").CSSProperties;
|
|
118
|
+
labelBgPadding?: [number, number];
|
|
119
|
+
labelBgBorderRadius?: number;
|
|
120
|
+
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
121
|
+
data: import("../types").RelationshipData;
|
|
122
|
+
type: "relationship";
|
|
123
|
+
}>> | ((state: import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
124
|
+
source: string;
|
|
125
|
+
target: string;
|
|
126
|
+
style?: import("react").CSSProperties;
|
|
127
|
+
id: string;
|
|
128
|
+
zIndex?: number;
|
|
129
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
130
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
131
|
+
hidden?: boolean;
|
|
132
|
+
selected?: boolean;
|
|
133
|
+
selectable?: boolean;
|
|
134
|
+
deletable?: boolean;
|
|
135
|
+
ariaLabel?: string;
|
|
136
|
+
className?: string;
|
|
137
|
+
focusable?: boolean;
|
|
138
|
+
label?: import("react").ReactNode;
|
|
139
|
+
sourceHandle?: string | null;
|
|
140
|
+
targetHandle?: string | null;
|
|
141
|
+
animated?: boolean;
|
|
142
|
+
interactionWidth?: number;
|
|
143
|
+
labelStyle?: import("react").CSSProperties;
|
|
144
|
+
labelShowBg?: boolean;
|
|
145
|
+
labelBgStyle?: import("react").CSSProperties;
|
|
146
|
+
labelBgPadding?: [number, number];
|
|
147
|
+
labelBgBorderRadius?: number;
|
|
148
|
+
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
149
|
+
data: import("../types").RelationshipData;
|
|
150
|
+
type: "relationship";
|
|
151
|
+
}>) => import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
152
|
+
source: string;
|
|
153
|
+
target: string;
|
|
154
|
+
style?: import("react").CSSProperties;
|
|
155
|
+
id: string;
|
|
156
|
+
zIndex?: number;
|
|
157
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
158
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
159
|
+
hidden?: boolean;
|
|
160
|
+
selected?: boolean;
|
|
161
|
+
selectable?: boolean;
|
|
162
|
+
deletable?: boolean;
|
|
163
|
+
ariaLabel?: string;
|
|
164
|
+
className?: string;
|
|
165
|
+
focusable?: boolean;
|
|
166
|
+
label?: import("react").ReactNode;
|
|
167
|
+
sourceHandle?: string | null;
|
|
168
|
+
targetHandle?: string | null;
|
|
169
|
+
animated?: boolean;
|
|
170
|
+
interactionWidth?: number;
|
|
171
|
+
labelStyle?: import("react").CSSProperties;
|
|
172
|
+
labelShowBg?: boolean;
|
|
173
|
+
labelBgStyle?: import("react").CSSProperties;
|
|
174
|
+
labelBgPadding?: [number, number];
|
|
175
|
+
labelBgBorderRadius?: number;
|
|
176
|
+
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
177
|
+
data: import("../types").RelationshipData;
|
|
178
|
+
type: "relationship";
|
|
179
|
+
}> | Partial<import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
180
|
+
source: string;
|
|
181
|
+
target: string;
|
|
182
|
+
style?: import("react").CSSProperties;
|
|
183
|
+
id: string;
|
|
184
|
+
zIndex?: number;
|
|
185
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
186
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
187
|
+
hidden?: boolean;
|
|
188
|
+
selected?: boolean;
|
|
189
|
+
selectable?: boolean;
|
|
190
|
+
deletable?: boolean;
|
|
191
|
+
ariaLabel?: string;
|
|
192
|
+
className?: string;
|
|
193
|
+
focusable?: boolean;
|
|
194
|
+
label?: import("react").ReactNode;
|
|
195
|
+
sourceHandle?: string | null;
|
|
196
|
+
targetHandle?: string | null;
|
|
197
|
+
animated?: boolean;
|
|
198
|
+
interactionWidth?: number;
|
|
199
|
+
labelStyle?: import("react").CSSProperties;
|
|
200
|
+
labelShowBg?: boolean;
|
|
201
|
+
labelBgStyle?: import("react").CSSProperties;
|
|
202
|
+
labelBgPadding?: [number, number];
|
|
203
|
+
labelBgBorderRadius?: number;
|
|
204
|
+
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
205
|
+
data: import("../types").RelationshipData;
|
|
206
|
+
type: "relationship";
|
|
207
|
+
}>>), replace?: boolean | undefined) => void;
|
|
208
|
+
subscribe: (listener: (state: import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
209
|
+
source: string;
|
|
210
|
+
target: string;
|
|
211
|
+
style?: import("react").CSSProperties;
|
|
212
|
+
id: string;
|
|
213
|
+
zIndex?: number;
|
|
214
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
215
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
216
|
+
hidden?: boolean;
|
|
217
|
+
selected?: boolean;
|
|
218
|
+
selectable?: boolean;
|
|
219
|
+
deletable?: boolean;
|
|
220
|
+
ariaLabel?: string;
|
|
221
|
+
className?: string;
|
|
222
|
+
focusable?: boolean;
|
|
223
|
+
label?: import("react").ReactNode;
|
|
224
|
+
sourceHandle?: string | null;
|
|
225
|
+
targetHandle?: string | null;
|
|
226
|
+
animated?: boolean;
|
|
227
|
+
interactionWidth?: number;
|
|
228
|
+
labelStyle?: import("react").CSSProperties;
|
|
229
|
+
labelShowBg?: boolean;
|
|
230
|
+
labelBgStyle?: import("react").CSSProperties;
|
|
231
|
+
labelBgPadding?: [number, number];
|
|
232
|
+
labelBgBorderRadius?: number;
|
|
233
|
+
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
234
|
+
data: import("../types").RelationshipData;
|
|
235
|
+
type: "relationship";
|
|
236
|
+
}>, prevState: import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
237
|
+
source: string;
|
|
238
|
+
target: string;
|
|
239
|
+
style?: import("react").CSSProperties;
|
|
240
|
+
id: string;
|
|
241
|
+
zIndex?: number;
|
|
242
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
243
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
244
|
+
hidden?: boolean;
|
|
245
|
+
selected?: boolean;
|
|
246
|
+
selectable?: boolean;
|
|
247
|
+
deletable?: boolean;
|
|
248
|
+
ariaLabel?: string;
|
|
249
|
+
className?: string;
|
|
250
|
+
focusable?: boolean;
|
|
251
|
+
label?: import("react").ReactNode;
|
|
252
|
+
sourceHandle?: string | null;
|
|
253
|
+
targetHandle?: string | null;
|
|
254
|
+
animated?: boolean;
|
|
255
|
+
interactionWidth?: number;
|
|
256
|
+
labelStyle?: import("react").CSSProperties;
|
|
257
|
+
labelShowBg?: boolean;
|
|
258
|
+
labelBgStyle?: import("react").CSSProperties;
|
|
259
|
+
labelBgPadding?: [number, number];
|
|
260
|
+
labelBgBorderRadius?: number;
|
|
261
|
+
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
262
|
+
data: import("../types").RelationshipData;
|
|
263
|
+
type: "relationship";
|
|
264
|
+
}>) => void) => () => void;
|
|
265
|
+
};
|
|
266
|
+
export type XYStoreApi = ReturnType<typeof useXYStoreApi>;
|
|
@@ -4,4 +4,3 @@ import { NodeProps } from '@xyflow/react';
|
|
|
4
4
|
type CompoundNodeProps = Pick<NodeProps<CompoundXYFlowNode>, 'id' | 'data' | 'width' | 'height' | 'selected'>;
|
|
5
5
|
export declare const CompoundNodeMemo: import('react').NamedExoticComponent<CompoundNodeProps>;
|
|
6
6
|
export {};
|
|
7
|
-
//# sourceMappingURL=CompoundNode.d.ts.map
|
|
@@ -6,6 +6,5 @@ type ElementIconProps = {
|
|
|
6
6
|
paddingX?: number | undefined;
|
|
7
7
|
paddingY?: number | undefined;
|
|
8
8
|
};
|
|
9
|
-
export declare function ElementIcon({ node,
|
|
9
|
+
export declare function ElementIcon({ node, paddingY }: ElementIconProps): JSX.Element | null;
|
|
10
10
|
export {};
|
|
11
|
-
//# sourceMappingURL=ElementIcon.d.ts.map
|
|
@@ -3,6 +3,5 @@ import { XYFlowNode } from '../../types';
|
|
|
3
3
|
type ElementLinkProps = {
|
|
4
4
|
element: XYFlowNode['data']['element'];
|
|
5
5
|
};
|
|
6
|
-
export declare function ElementLink({ element }: ElementLinkProps): JSX.Element
|
|
6
|
+
export declare function ElementLink({ element }: ElementLinkProps): JSX.Element;
|
|
7
7
|
export {};
|
|
8
|
-
//# sourceMappingURL=ElementLink.d.ts.map
|
|
@@ -2,7 +2,5 @@ import { ElementXYFlowNode } from '../../types';
|
|
|
2
2
|
import { NodeProps } from '@xyflow/react';
|
|
3
3
|
|
|
4
4
|
type ElementNodeProps = NodeProps<ElementXYFlowNode>;
|
|
5
|
-
declare function ElementNode({ id, data: { element }, selected, width, height }: ElementNodeProps): JSX.Element;
|
|
6
|
-
export declare const ElementNodeMemo: typeof ElementNode;
|
|
5
|
+
export declare function ElementNode({ id, data: { element }, dragging, selected, width, height }: ElementNodeProps): JSX.Element;
|
|
7
6
|
export {};
|
|
8
|
-
//# sourceMappingURL=ElementNode.d.ts.map
|
|
@@ -5,10 +5,9 @@ type ElementShapeSvgProps = {
|
|
|
5
5
|
w: number;
|
|
6
6
|
h: number;
|
|
7
7
|
};
|
|
8
|
-
export declare
|
|
8
|
+
export declare function ElementShapeSvg({ shape, w, h }: ElementShapeSvgProps): JSX.Element;
|
|
9
9
|
/**
|
|
10
10
|
* When element is selected, this component is used to render the indicator
|
|
11
11
|
*/
|
|
12
|
-
export declare
|
|
12
|
+
export declare function SelectedIndicator({ shape, w, h }: ElementShapeSvgProps): JSX.Element;
|
|
13
13
|
export {};
|
|
14
|
-
//# sourceMappingURL=ElementShapeSvg.d.ts.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { ElementNode } from './ElementNode';
|