@likec4/diagram 1.8.1 → 1.12.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.
Files changed (114) hide show
  1. package/package.json +21 -45
  2. package/src/LikeC4CustomColors.props.ts +5 -0
  3. package/src/LikeC4CustomColors.tsx +37 -0
  4. package/src/LikeC4Diagram.css.ts +1 -1
  5. package/src/LikeC4Diagram.props.ts +43 -95
  6. package/src/LikeC4Diagram.tsx +21 -2
  7. package/src/LikeC4ModelProvider.tsx +49 -0
  8. package/src/StaticLikeC4Diagram.tsx +1 -0
  9. package/src/globals.css.ts +2 -3
  10. package/src/hooks/index.ts +1 -0
  11. package/src/hooks/useMantinePortalProps.ts +8 -0
  12. package/src/hooks/useXYFlow.ts +1 -2
  13. package/src/index.ts +3 -0
  14. package/src/likec4model/LikeC4ModelContext.ts +4 -0
  15. package/src/likec4model/index.ts +1 -0
  16. package/src/likec4model/useLikeC4Model.ts +55 -0
  17. package/src/mantine/EnsureMantine.tsx +1 -0
  18. package/src/state/DiagramContext.tsx +1 -0
  19. package/src/state/diagram-to-xyflow.ts +2 -3
  20. package/src/state/diagramStore.ts +185 -66
  21. package/src/{theme.css.ts → theme-vars.ts} +11 -4
  22. package/src/ui/DiagramTitlePanel.css.ts +2 -3
  23. package/src/ui/DiagramTitlePanel.tsx +17 -1
  24. package/src/ui/DynamicViewWalkthrough.css.ts +28 -2
  25. package/src/ui/DynamicViewWalkthrough.tsx +97 -52
  26. package/src/ui/OptionsPanel.css.ts +1 -2
  27. package/src/ui/OptionsPanel.tsx +1 -1
  28. package/src/ui/notation/NotationPanel.css.ts +2 -3
  29. package/src/ui/notation/NotationPanel.tsx +11 -12
  30. package/src/ui/options/NodeOptions.tsx +1 -1
  31. package/src/ui/top-left/ChangeAutoLayoutButton.tsx +20 -32
  32. package/src/ui/top-left/TopLeftPanel.tsx +128 -117
  33. package/src/ui/top-left/_shared.ts +7 -6
  34. package/src/ui/top-left/styles.css.ts +17 -8
  35. package/src/utils/vector.ts +57 -0
  36. package/src/xyflow/FitviewOnDiagramChange.tsx +5 -4
  37. package/src/xyflow/SelectEdgesOnNodeFocus.tsx +7 -5
  38. package/src/xyflow/XYFlow.tsx +10 -11
  39. package/src/xyflow/XYFlowEvents.tsx +59 -60
  40. package/src/xyflow/XYFlowInner.tsx +5 -5
  41. package/src/xyflow/edges/EdgeLabel.tsx +185 -0
  42. package/src/xyflow/edges/RelationshipEdge.tsx +170 -137
  43. package/src/xyflow/edges/RelationshipsDropdownMenu.css.ts +60 -0
  44. package/src/xyflow/edges/RelationshipsDropdownMenu.tsx +214 -0
  45. package/src/xyflow/edges/edges.css.ts +75 -7
  46. package/src/xyflow/nodes/compound/CompoundNode.css.ts +1 -2
  47. package/src/xyflow/nodes/compound/CompoundNode.tsx +4 -4
  48. package/src/xyflow/nodes/element/ElementLink.css.ts +1 -1
  49. package/src/xyflow/nodes/element/ElementLink.tsx +3 -8
  50. package/src/xyflow/nodes/element/ElementNode.tsx +47 -4
  51. package/src/xyflow/nodes/element/element.css.ts +1 -2
  52. package/src/xyflow/types.ts +1 -24
  53. package/src/xyflow/useLayoutConstraints.ts +10 -6
  54. package/src/xyflow/utils.ts +1 -1
  55. package/dist/LikeC4Diagram.css.d.ts +0 -4
  56. package/dist/LikeC4Diagram.d.ts +0 -4
  57. package/dist/LikeC4Diagram.props.d.ts +0 -185
  58. package/dist/StaticLikeC4Diagram.d.ts +0 -4
  59. package/dist/globals.css.d.ts +0 -1
  60. package/dist/hooks/index.d.ts +0 -4
  61. package/dist/hooks/useDiagramState.d.ts +0 -6
  62. package/dist/hooks/useSetState.d.ts +0 -3
  63. package/dist/hooks/useUpdateEffect.d.ts +0 -5
  64. package/dist/hooks/useXYFlow.d.ts +0 -267
  65. package/dist/index.d.ts +0 -9
  66. package/dist/index.mjs +0 -3651
  67. package/dist/mantine/EnsureMantine.d.ts +0 -5
  68. package/dist/mantine.css.d.ts +0 -3
  69. package/dist/state/DiagramContext.d.ts +0 -1189
  70. package/dist/state/diagram-to-xyflow.d.ts +0 -12
  71. package/dist/state/diagramStore.d.ts +0 -1268
  72. package/dist/style.css +0 -2139
  73. package/dist/theme.css.d.ts +0 -63
  74. package/dist/ui/DiagramTitlePanel.css.d.ts +0 -4
  75. package/dist/ui/DiagramTitlePanel.d.ts +0 -1
  76. package/dist/ui/DynamicViewWalkthrough.css.d.ts +0 -3
  77. package/dist/ui/DynamicViewWalkthrough.d.ts +0 -1
  78. package/dist/ui/OptionsPanel.css.d.ts +0 -1
  79. package/dist/ui/OptionsPanel.d.ts +0 -1
  80. package/dist/ui/notation/NotationPanel.css.d.ts +0 -6
  81. package/dist/ui/notation/NotationPanel.d.ts +0 -1
  82. package/dist/ui/notation/index.d.ts +0 -1
  83. package/dist/ui/options/EdgeOptions.d.ts +0 -19
  84. package/dist/ui/options/NodeOptions.d.ts +0 -19
  85. package/dist/ui/top-left/ChangeAutoLayoutButton.d.ts +0 -3
  86. package/dist/ui/top-left/TopLeftPanel.d.ts +0 -4
  87. package/dist/ui/top-left/_shared.d.ts +0 -5
  88. package/dist/ui/top-left/styles.css.d.ts +0 -3
  89. package/dist/xyflow/EdgeMarkers.d.ts +0 -12
  90. package/dist/xyflow/FitviewOnDiagramChange.d.ts +0 -4
  91. package/dist/xyflow/SelectEdgesOnNodeFocus.d.ts +0 -1
  92. package/dist/xyflow/XYFlow.d.ts +0 -9
  93. package/dist/xyflow/XYFlowBackground.d.ts +0 -11
  94. package/dist/xyflow/XYFlowEvents.d.ts +0 -161
  95. package/dist/xyflow/XYFlowInner.d.ts +0 -10
  96. package/dist/xyflow/const.d.ts +0 -7
  97. package/dist/xyflow/edges/RelationshipEdge.d.ts +0 -32
  98. package/dist/xyflow/edges/edges.css.d.ts +0 -12
  99. package/dist/xyflow/edges/utils.d.ts +0 -17
  100. package/dist/xyflow/nodes/compound/CompoundNode.css.d.ts +0 -11
  101. package/dist/xyflow/nodes/compound/CompoundNode.d.ts +0 -6
  102. package/dist/xyflow/nodes/compound/index.d.ts +0 -1
  103. package/dist/xyflow/nodes/element/ElementLink.css.d.ts +0 -3
  104. package/dist/xyflow/nodes/element/ElementLink.d.ts +0 -7
  105. package/dist/xyflow/nodes/element/ElementNode.d.ts +0 -6
  106. package/dist/xyflow/nodes/element/ElementShapeSvg.d.ts +0 -18
  107. package/dist/xyflow/nodes/element/element.css.d.ts +0 -19
  108. package/dist/xyflow/nodes/element/index.d.ts +0 -1
  109. package/dist/xyflow/nodes/shared/NavigateToBtn.d.ts +0 -5
  110. package/dist/xyflow/types.d.ts +0 -50
  111. package/dist/xyflow/useLayoutConstraints.d.ts +0 -9
  112. package/dist/xyflow/utils.d.ts +0 -18
  113. package/src/mantine.css.ts +0 -7
  114. package/src/reset.d.ts +0 -2
@@ -1,185 +0,0 @@
1
- import { DiagramEdge, DiagramNode, DiagramView, Fqn, NonEmptyArray, RelationID, ViewChange, ViewID } from '@likec4/core';
2
- import { MouseEvent as ReactMouseEvent, ReactNode } from 'react';
3
- import { XYFlowEdge, XYFlowNode } from './xyflow/types';
4
- import { XYBackground } from './xyflow/XYFlowBackground';
5
-
6
- type EqualOperator<V> = {
7
- eq: V;
8
- neq?: never;
9
- } | {
10
- eq?: never;
11
- neq: V;
12
- };
13
- type AllNever = {
14
- not?: never;
15
- and?: never;
16
- or?: never;
17
- tag?: never;
18
- kind?: never;
19
- };
20
- type TagKindOperator<Tag, Kind> = Omit<AllNever, 'tag' | 'kind'> & ({
21
- tag: EqualOperator<Tag>;
22
- kind?: never;
23
- } | {
24
- tag?: never;
25
- kind: EqualOperator<Kind>;
26
- });
27
- type NotOperator<Tag, Kind> = Omit<AllNever, 'not'> & {
28
- not: TagKindOperator<Tag, Kind> | AndOperator<Tag, Kind> | OrOperator<Tag, Kind>;
29
- };
30
- type AndOperator<Tag, Kind> = Omit<AllNever, 'and'> & {
31
- and: NonEmptyArray<TagKindOperator<Tag, Kind> | OrOperator<Tag, Kind> | NotOperator<Tag, Kind>>;
32
- };
33
- type OrOperator<Tag, Kind> = Omit<AllNever, 'or'> & {
34
- or: NonEmptyArray<TagKindOperator<Tag, Kind> | AndOperator<Tag, Kind> | NotOperator<Tag, Kind>>;
35
- };
36
- export type WhereOperator<Tag extends string, Kind extends string> = TagKindOperator<Tag, Kind> | NotOperator<Tag, Kind> | AndOperator<Tag, Kind> | OrOperator<Tag, Kind>;
37
- export type DiagramNodeWithNavigate = Omit<DiagramNode, 'navigateTo'> & {
38
- navigateTo: ViewID;
39
- };
40
- type ElementIconNodeProps = {
41
- id: string;
42
- title: string;
43
- icon?: string | undefined;
44
- };
45
- export type ElementIconRenderer = (props: {
46
- node: ElementIconNodeProps;
47
- }) => ReactNode;
48
- export type OnNavigateTo = {
49
- (to: ViewID, event?: ReactMouseEvent, element?: DiagramNodeWithNavigate, xynode?: XYFlowNode): void;
50
- };
51
- export type OnNodeClick = (event: {
52
- element: DiagramNode;
53
- xynode: XYFlowNode;
54
- event: ReactMouseEvent;
55
- }) => void;
56
- export type OnEdgeClick = (event: {
57
- edge: DiagramEdge;
58
- xyedge: XYFlowEdge;
59
- event: ReactMouseEvent;
60
- }) => void;
61
- /**
62
- * On pane/canvas click (not on any node or edge)
63
- */
64
- export type OnCanvasClick = (event: ReactMouseEvent) => void;
65
- export type ChangeEvent = {
66
- change: ViewChange;
67
- };
68
- export type OnChange = {
69
- (event: ChangeEvent): void;
70
- };
71
- export type LikeC4ColorScheme = 'light' | 'dark';
72
- export interface LikeC4DiagramProperties {
73
- view: DiagramView;
74
- className?: string | undefined;
75
- /**
76
- * Controls color scheme used for styling the flow
77
- * By default inherits from system or surrounding MantineProvider
78
- *
79
- * @example 'light' | 'dark'
80
- */
81
- /**
82
- * Show/hide controls menu
83
- * @default false
84
- */
85
- controls?: boolean | undefined;
86
- /**
87
- * Enable/disable panning
88
- * @default true
89
- */
90
- pannable?: boolean | undefined;
91
- /**
92
- * Enable/disable zooming
93
- * @default true
94
- */
95
- zoomable?: boolean | undefined;
96
- /**
97
- * Disable any editing (dragging still can be enabled with `nodesDraggable`)
98
- * @default true
99
- */
100
- readonly?: boolean | undefined;
101
- /**
102
- * If set, initial viewport will show all nodes & edges
103
- * @default true
104
- */
105
- fitView?: boolean | undefined;
106
- /**
107
- * Seems like this is percentage of the view size
108
- * @default 0
109
- */
110
- fitViewPadding?: number | undefined;
111
- nodesSelectable?: boolean | undefined;
112
- /**
113
- * @default false
114
- */
115
- nodesDraggable?: boolean | undefined;
116
- initialWidth?: number | undefined;
117
- initialHeight?: number | undefined;
118
- /**
119
- * Keep aspect ratio of the diagram
120
- * @default false
121
- */
122
- keepAspectRatio?: boolean | undefined;
123
- /**
124
- * Background pattern
125
- * @default 'dots'
126
- */
127
- background?: 'transparent' | 'solid' | XYBackground | undefined;
128
- /**
129
- * Display hovercards with element links
130
- * @default true
131
- */
132
- showElementLinks?: boolean | undefined;
133
- /**
134
- * Display panel with diagram title / description
135
- * @default true
136
- */
137
- showDiagramTitle?: boolean | undefined;
138
- /**
139
- * Show back/forward navigation buttons
140
- * @default false
141
- */
142
- showNavigationButtons?: undefined | boolean;
143
- /**
144
- * Display notations of the view
145
- * @default true
146
- */
147
- showNotations?: boolean | undefined;
148
- /**
149
- * If double click on a node should enable focus mode, i.e. highlight incoming/outgoing edges
150
- * @default true
151
- */
152
- enableFocusMode?: boolean | undefined;
153
- /**
154
- * If Walkthrough for dynamic views should be enabled
155
- * @default false
156
- */
157
- enableDynamicViewWalkthrough?: boolean | undefined;
158
- /**
159
- * Experimental feature to enable edge editing
160
- * @default false
161
- */
162
- experimentalEdgeEditing?: boolean | undefined;
163
- /**
164
- * Render custom icon for a node
165
- * By default, if icon is http:// or https://, it will be rendered as an image
166
- */
167
- renderIcon?: ElementIconRenderer | undefined;
168
- where?: WhereOperator<string, string> | undefined;
169
- }
170
- export interface LikeC4DiagramEventHandlers {
171
- onChange?: OnChange | null | undefined;
172
- onNavigateTo?: OnNavigateTo | null | undefined;
173
- onNodeClick?: OnNodeClick | null | undefined;
174
- onNodeContextMenu?: OnNodeClick | null | undefined;
175
- onCanvasContextMenu?: OnCanvasClick | null | undefined;
176
- onEdgeClick?: OnEdgeClick | null | undefined;
177
- onEdgeContextMenu?: OnEdgeClick | null | undefined;
178
- onCanvasClick?: OnCanvasClick | null | undefined;
179
- onCanvasDblClick?: OnCanvasClick | null | undefined;
180
- onBurgerMenuClick?: null | undefined | (() => void);
181
- onOpenSourceView?: null | undefined | (() => void);
182
- onOpenSourceElement?: null | undefined | ((fqn: Fqn) => void);
183
- onOpenSourceRelation?: null | undefined | ((id: RelationID) => void);
184
- }
185
- export {};
@@ -1,4 +0,0 @@
1
- import { LikeC4DiagramProperties } from './LikeC4Diagram.props';
2
-
3
- export type StaticLikeC4DiagramProps = Pick<LikeC4DiagramProperties, 'view' | 'keepAspectRatio' | 'className' | 'fitView' | 'fitViewPadding' | 'background' | 'initialWidth' | 'initialHeight' | 'renderIcon' | 'where'>;
4
- export declare function StaticLikeC4Diagram({ view, fitView, fitViewPadding, background, ...rest }: StaticLikeC4DiagramProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const rootClassName = "likec4-diagram-root";
@@ -1,4 +0,0 @@
1
- export * from './useDiagramState';
2
- export * from './useSetState';
3
- export * from './useUpdateEffect';
4
- export * from './useXYFlow';
@@ -1,6 +0,0 @@
1
- import { DiagramState, DiagramStoreApi } from '../state/diagramStore';
2
-
3
- declare function useDiagramState<StateSlice = unknown>(selector: (state: DiagramState) => StateSlice, equalityFn?: (a: StateSlice, b: StateSlice) => boolean): StateSlice;
4
- declare function useDiagramStoreApi(): DiagramStoreApi;
5
- export type { DiagramState, DiagramStoreApi };
6
- export { useDiagramState, useDiagramStoreApi };
@@ -1,3 +0,0 @@
1
- import { NonEmptyObject } from 'type-fest';
2
-
3
- export declare function useSetState<T extends object>(initialState: T | (() => T)): readonly [T, (statePartial: NonEmptyObject<Partial<T>> | ((current: T) => NonEmptyObject<Partial<T>>)) => void];
@@ -1,5 +0,0 @@
1
- import { DependenciesComparator, EffectHook } from '@react-hookz/web';
2
- import { DependencyList, EffectCallback } from 'react';
3
-
4
- export declare const depsShallowEqual: DependenciesComparator;
5
- export declare function useUpdateEffect<Callback extends EffectCallback = EffectCallback, Deps extends DependencyList = DependencyList>(callback: Callback, deps: Deps, equalityFn?: DependenciesComparator<Deps>, effectHook?: EffectHook<Callback, Deps>): void;
@@ -1,267 +0,0 @@
1
- import { XYFlowEdge, XYFlowNode, XYFlowState } from '../xyflow/types';
2
-
3
- export declare const useXYFlow: () => import('@xyflow/react').ReactFlowInstance<XYFlowNode, {
4
- id: string;
5
- type: "relationship";
6
- source: string;
7
- target: string;
8
- sourceHandle?: string | null;
9
- targetHandle?: string | null;
10
- animated?: boolean;
11
- hidden?: boolean;
12
- deletable?: boolean;
13
- selectable?: boolean;
14
- data: import('../xyflow/types').RelationshipData;
15
- selected?: boolean;
16
- markerStart?: import('@xyflow/react').EdgeMarkerType;
17
- markerEnd?: import('@xyflow/react').EdgeMarkerType;
18
- zIndex?: number;
19
- ariaLabel?: string;
20
- interactionWidth?: number;
21
- label?: string | import('react').ReactNode;
22
- labelStyle?: import('react').CSSProperties;
23
- labelShowBg?: boolean;
24
- labelBgStyle?: import('react').CSSProperties;
25
- labelBgPadding?: [number, number];
26
- labelBgBorderRadius?: number;
27
- style?: import('react').CSSProperties;
28
- className?: string;
29
- reconnectable?: boolean | import('@xyflow/react').HandleType;
30
- focusable?: boolean;
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
- id: string;
40
- type: "relationship";
41
- source: string;
42
- target: string;
43
- sourceHandle?: string | null;
44
- targetHandle?: string | null;
45
- animated?: boolean;
46
- hidden?: boolean;
47
- deletable?: boolean;
48
- selectable?: boolean;
49
- data: import('../xyflow/types').RelationshipData;
50
- selected?: boolean;
51
- markerStart?: import('@xyflow/react').EdgeMarkerType;
52
- markerEnd?: import('@xyflow/react').EdgeMarkerType;
53
- zIndex?: number;
54
- ariaLabel?: string;
55
- interactionWidth?: number;
56
- label?: string | import('react').ReactNode;
57
- labelStyle?: import('react').CSSProperties;
58
- labelShowBg?: boolean;
59
- labelBgStyle?: import('react').CSSProperties;
60
- labelBgPadding?: [number, number];
61
- labelBgBorderRadius?: number;
62
- style?: import('react').CSSProperties;
63
- className?: string;
64
- reconnectable?: boolean | import('@xyflow/react').HandleType;
65
- focusable?: boolean;
66
- }>;
67
- setState: (partial: import('@xyflow/react').ReactFlowState<XYFlowNode, {
68
- id: string;
69
- type: "relationship";
70
- source: string;
71
- target: string;
72
- sourceHandle?: string | null;
73
- targetHandle?: string | null;
74
- animated?: boolean;
75
- hidden?: boolean;
76
- deletable?: boolean;
77
- selectable?: boolean;
78
- data: import('../xyflow/types').RelationshipData;
79
- selected?: boolean;
80
- markerStart?: import('@xyflow/react').EdgeMarkerType;
81
- markerEnd?: import('@xyflow/react').EdgeMarkerType;
82
- zIndex?: number;
83
- ariaLabel?: string;
84
- interactionWidth?: number;
85
- label?: string | import('react').ReactNode;
86
- labelStyle?: import('react').CSSProperties;
87
- labelShowBg?: boolean;
88
- labelBgStyle?: import('react').CSSProperties;
89
- labelBgPadding?: [number, number];
90
- labelBgBorderRadius?: number;
91
- style?: import('react').CSSProperties;
92
- className?: string;
93
- reconnectable?: boolean | import('@xyflow/react').HandleType;
94
- focusable?: boolean;
95
- }> | Partial<import('@xyflow/react').ReactFlowState<XYFlowNode, {
96
- id: string;
97
- type: "relationship";
98
- source: string;
99
- target: string;
100
- sourceHandle?: string | null;
101
- targetHandle?: string | null;
102
- animated?: boolean;
103
- hidden?: boolean;
104
- deletable?: boolean;
105
- selectable?: boolean;
106
- data: import('../xyflow/types').RelationshipData;
107
- selected?: boolean;
108
- markerStart?: import('@xyflow/react').EdgeMarkerType;
109
- markerEnd?: import('@xyflow/react').EdgeMarkerType;
110
- zIndex?: number;
111
- ariaLabel?: string;
112
- interactionWidth?: number;
113
- label?: string | import('react').ReactNode;
114
- labelStyle?: import('react').CSSProperties;
115
- labelShowBg?: boolean;
116
- labelBgStyle?: import('react').CSSProperties;
117
- labelBgPadding?: [number, number];
118
- labelBgBorderRadius?: number;
119
- style?: import('react').CSSProperties;
120
- className?: string;
121
- reconnectable?: boolean | import('@xyflow/react').HandleType;
122
- focusable?: boolean;
123
- }>> | ((state: import('@xyflow/react').ReactFlowState<XYFlowNode, {
124
- id: string;
125
- type: "relationship";
126
- source: string;
127
- target: string;
128
- sourceHandle?: string | null;
129
- targetHandle?: string | null;
130
- animated?: boolean;
131
- hidden?: boolean;
132
- deletable?: boolean;
133
- selectable?: boolean;
134
- data: import('../xyflow/types').RelationshipData;
135
- selected?: boolean;
136
- markerStart?: import('@xyflow/react').EdgeMarkerType;
137
- markerEnd?: import('@xyflow/react').EdgeMarkerType;
138
- zIndex?: number;
139
- ariaLabel?: string;
140
- interactionWidth?: number;
141
- label?: string | import('react').ReactNode;
142
- labelStyle?: import('react').CSSProperties;
143
- labelShowBg?: boolean;
144
- labelBgStyle?: import('react').CSSProperties;
145
- labelBgPadding?: [number, number];
146
- labelBgBorderRadius?: number;
147
- style?: import('react').CSSProperties;
148
- className?: string;
149
- reconnectable?: boolean | import('@xyflow/react').HandleType;
150
- focusable?: boolean;
151
- }>) => import('@xyflow/react').ReactFlowState<XYFlowNode, {
152
- id: string;
153
- type: "relationship";
154
- source: string;
155
- target: string;
156
- sourceHandle?: string | null;
157
- targetHandle?: string | null;
158
- animated?: boolean;
159
- hidden?: boolean;
160
- deletable?: boolean;
161
- selectable?: boolean;
162
- data: import('../xyflow/types').RelationshipData;
163
- selected?: boolean;
164
- markerStart?: import('@xyflow/react').EdgeMarkerType;
165
- markerEnd?: import('@xyflow/react').EdgeMarkerType;
166
- zIndex?: number;
167
- ariaLabel?: string;
168
- interactionWidth?: number;
169
- label?: string | import('react').ReactNode;
170
- labelStyle?: import('react').CSSProperties;
171
- labelShowBg?: boolean;
172
- labelBgStyle?: import('react').CSSProperties;
173
- labelBgPadding?: [number, number];
174
- labelBgBorderRadius?: number;
175
- style?: import('react').CSSProperties;
176
- className?: string;
177
- reconnectable?: boolean | import('@xyflow/react').HandleType;
178
- focusable?: boolean;
179
- }> | Partial<import('@xyflow/react').ReactFlowState<XYFlowNode, {
180
- id: string;
181
- type: "relationship";
182
- source: string;
183
- target: string;
184
- sourceHandle?: string | null;
185
- targetHandle?: string | null;
186
- animated?: boolean;
187
- hidden?: boolean;
188
- deletable?: boolean;
189
- selectable?: boolean;
190
- data: import('../xyflow/types').RelationshipData;
191
- selected?: boolean;
192
- markerStart?: import('@xyflow/react').EdgeMarkerType;
193
- markerEnd?: import('@xyflow/react').EdgeMarkerType;
194
- zIndex?: number;
195
- ariaLabel?: string;
196
- interactionWidth?: number;
197
- label?: string | import('react').ReactNode;
198
- labelStyle?: import('react').CSSProperties;
199
- labelShowBg?: boolean;
200
- labelBgStyle?: import('react').CSSProperties;
201
- labelBgPadding?: [number, number];
202
- labelBgBorderRadius?: number;
203
- style?: import('react').CSSProperties;
204
- className?: string;
205
- reconnectable?: boolean | import('@xyflow/react').HandleType;
206
- focusable?: boolean;
207
- }>>), replace?: boolean | undefined) => void;
208
- subscribe: (listener: (state: import('@xyflow/react').ReactFlowState<XYFlowNode, {
209
- id: string;
210
- type: "relationship";
211
- source: string;
212
- target: string;
213
- sourceHandle?: string | null;
214
- targetHandle?: string | null;
215
- animated?: boolean;
216
- hidden?: boolean;
217
- deletable?: boolean;
218
- selectable?: boolean;
219
- data: import('../xyflow/types').RelationshipData;
220
- selected?: boolean;
221
- markerStart?: import('@xyflow/react').EdgeMarkerType;
222
- markerEnd?: import('@xyflow/react').EdgeMarkerType;
223
- zIndex?: number;
224
- ariaLabel?: string;
225
- interactionWidth?: number;
226
- label?: string | import('react').ReactNode;
227
- labelStyle?: import('react').CSSProperties;
228
- labelShowBg?: boolean;
229
- labelBgStyle?: import('react').CSSProperties;
230
- labelBgPadding?: [number, number];
231
- labelBgBorderRadius?: number;
232
- style?: import('react').CSSProperties;
233
- className?: string;
234
- reconnectable?: boolean | import('@xyflow/react').HandleType;
235
- focusable?: boolean;
236
- }>, prevState: import('@xyflow/react').ReactFlowState<XYFlowNode, {
237
- id: string;
238
- type: "relationship";
239
- source: string;
240
- target: string;
241
- sourceHandle?: string | null;
242
- targetHandle?: string | null;
243
- animated?: boolean;
244
- hidden?: boolean;
245
- deletable?: boolean;
246
- selectable?: boolean;
247
- data: import('../xyflow/types').RelationshipData;
248
- selected?: boolean;
249
- markerStart?: import('@xyflow/react').EdgeMarkerType;
250
- markerEnd?: import('@xyflow/react').EdgeMarkerType;
251
- zIndex?: number;
252
- ariaLabel?: string;
253
- interactionWidth?: number;
254
- label?: string | import('react').ReactNode;
255
- labelStyle?: import('react').CSSProperties;
256
- labelShowBg?: boolean;
257
- labelBgStyle?: import('react').CSSProperties;
258
- labelBgPadding?: [number, number];
259
- labelBgBorderRadius?: number;
260
- style?: import('react').CSSProperties;
261
- className?: string;
262
- reconnectable?: boolean | import('@xyflow/react').HandleType;
263
- focusable?: boolean;
264
- }>) => void) => () => void;
265
- };
266
- export type XYStoreApi = ReturnType<typeof useXYStoreApi>;
267
- export declare function useXYEdgesData(edgeIds: string[]): Pick<XYFlowEdge, 'id' | 'data'>[];
package/dist/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
-
2
- export { LikeC4Diagram } from './LikeC4Diagram';
3
- export { StaticLikeC4Diagram } from './StaticLikeC4Diagram';
4
- export { useSetState } from './hooks/useSetState';
5
- export { useUpdateEffect } from './hooks/useUpdateEffect';
6
- export type * from './LikeC4Diagram';
7
- export type * from './LikeC4Diagram.props';
8
- export type * from './StaticLikeC4Diagram';
9
- export type * from './xyflow/types';