@likec4/diagram 1.1.1 → 1.2.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/KeepAspectRatioContainer.d.ts +1 -1
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.props.d.ts +7 -2
- package/dist/StaticLikeC4Diagram.d.ts +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +2517 -1326
- package/dist/mantine/EnsureMantine.d.ts +1 -1
- package/dist/state/DiagramContext.d.ts +2125 -10
- package/dist/state/WhenInitialized.d.ts +1 -1
- package/dist/state/diagramStore.d.ts +2133 -10
- package/dist/state/useDiagramStore.d.ts +2124 -9
- package/dist/style.css +210 -136
- package/dist/theme.css.d.ts +1 -0
- package/dist/ui/DiagramTitlePanel.d.ts +1 -2
- package/dist/ui/DynamicViewWalkthrough.css.d.ts +3 -0
- package/dist/ui/DynamicViewWalkthrough.d.ts +1 -0
- package/dist/ui/OptionsPanel.d.ts +1 -2
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/options/NodeOptions.d.ts +1 -2
- package/dist/xyflow/FitviewOnDiagramChange.d.ts +4 -2
- package/dist/xyflow/SyncWithDiagram.d.ts +1 -2
- package/dist/xyflow/XYFlow.d.ts +4 -7
- package/dist/xyflow/XYFlowBackground.d.ts +5 -4
- package/dist/xyflow/XYFlowEvents.d.ts +57 -63
- package/dist/xyflow/XYFlowInner.d.ts +11 -0
- package/dist/xyflow/diagram-to-xyflow.d.ts +1 -1
- package/dist/xyflow/edges/RelationshipEdge.d.ts +14 -14
- package/dist/xyflow/edges/edges.css.d.ts +4 -2
- package/dist/xyflow/edges/utils.d.ts +2 -0
- package/dist/xyflow/hooks/useXYFlow.d.ts +126 -126
- package/dist/xyflow/nodes/compound/CompoundNode.css.d.ts +1 -0
- package/dist/xyflow/nodes/element/ElementIcon.d.ts +1 -1
- package/dist/xyflow/nodes/element/ElementLink.d.ts +1 -1
- package/dist/xyflow/nodes/element/ElementNode.d.ts +1 -1
- package/dist/xyflow/nodes/element/ElementShapeSvg.d.ts +2 -2
- package/dist/xyflow/nodes/element/element.css.d.ts +2 -1
- package/dist/xyflow/nodes/shared/NavigateToBtn.d.ts +1 -2
- package/dist/xyflow/types.d.ts +18 -18
- package/package.json +19 -16
- package/src/KeepAspectRatioContainer.tsx +1 -1
- package/src/LikeC4Diagram.css.ts +2 -0
- package/src/LikeC4Diagram.props.ts +9 -4
- package/src/LikeC4Diagram.tsx +17 -11
- package/src/StaticLikeC4Diagram.tsx +1 -0
- package/src/globals.css.ts +1 -0
- package/src/index.ts +0 -3
- package/src/state/DiagramContext.tsx +21 -12
- package/src/state/diagramStore.ts +177 -38
- package/src/theme.css.ts +1 -0
- package/src/ui/DiagramTitlePanel.css.ts +2 -1
- package/src/ui/DiagramTitlePanel.tsx +3 -4
- package/src/ui/DynamicViewWalkthrough.css.ts +46 -0
- package/src/ui/DynamicViewWalkthrough.tsx +86 -0
- package/src/ui/OptionsPanel.tsx +5 -3
- package/src/ui/index.ts +1 -0
- package/src/ui/options/NodeOptions.tsx +23 -24
- package/src/xyflow/FitviewOnDiagramChange.tsx +89 -69
- package/src/xyflow/SelectEdgesOnNodeFocus.tsx +57 -39
- package/src/xyflow/SyncWithDiagram.tsx +55 -107
- package/src/xyflow/XYFlow.tsx +51 -35
- package/src/xyflow/XYFlowBackground.tsx +7 -5
- package/src/xyflow/XYFlowEvents.tsx +97 -92
- package/src/xyflow/XYFlowInner.tsx +50 -0
- package/src/xyflow/diagram-to-xyflow.ts +16 -21
- package/src/xyflow/edges/RelationshipEdge.tsx +70 -34
- package/src/xyflow/edges/edges.css.ts +68 -34
- package/src/xyflow/edges/utils.ts +31 -0
- package/src/xyflow/nodes/compound/CompoundNode.css.ts +6 -2
- package/src/xyflow/nodes/compound/CompoundNode.tsx +6 -3
- package/src/xyflow/nodes/element/ElementLink.tsx +13 -3
- package/src/xyflow/nodes/element/ElementNode.tsx +24 -19
- package/src/xyflow/nodes/element/element.css.ts +9 -2
- package/src/xyflow/nodes/shared/NavigateToBtn.tsx +1 -0
- package/src/xyflow/types.ts +7 -8
|
@@ -3,31 +3,31 @@ import { XYFlowNode, XYFlowState } from '../types';
|
|
|
3
3
|
export declare const useXYFlow: () => import('@xyflow/react').ReactFlowInstance<XYFlowNode, {
|
|
4
4
|
source: string;
|
|
5
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
|
-
className?: string;
|
|
13
|
-
label?: import("react").ReactNode;
|
|
14
|
-
selected?: boolean;
|
|
15
|
-
selectable?: boolean;
|
|
16
|
-
deletable?: boolean;
|
|
17
|
-
ariaLabel?: string;
|
|
18
|
-
focusable?: boolean;
|
|
19
6
|
sourceHandle?: string | null;
|
|
20
7
|
targetHandle?: string | null;
|
|
21
8
|
animated?: boolean;
|
|
9
|
+
hidden?: boolean;
|
|
10
|
+
deletable?: boolean;
|
|
11
|
+
selectable?: boolean;
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
14
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
15
|
+
zIndex?: number;
|
|
16
|
+
ariaLabel?: string;
|
|
22
17
|
interactionWidth?: number;
|
|
18
|
+
label?: import("react").ReactNode;
|
|
23
19
|
labelStyle?: import("react").CSSProperties;
|
|
24
20
|
labelShowBg?: boolean;
|
|
25
21
|
labelBgStyle?: import("react").CSSProperties;
|
|
26
22
|
labelBgPadding?: [number, number];
|
|
27
23
|
labelBgBorderRadius?: number;
|
|
24
|
+
style?: import("react").CSSProperties;
|
|
25
|
+
className?: string;
|
|
28
26
|
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
27
|
+
focusable?: boolean;
|
|
29
28
|
data: import("../types").RelationshipData;
|
|
30
|
-
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly type: "relationship";
|
|
31
31
|
}>;
|
|
32
32
|
export declare const useXYNodesData: {
|
|
33
33
|
(nodeId: string): Pick<XYFlowNode, "id" | "data" | "type"> | null;
|
|
@@ -38,229 +38,229 @@ export declare const useXYStoreApi: () => {
|
|
|
38
38
|
getState: () => import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
39
39
|
source: string;
|
|
40
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
|
-
className?: string;
|
|
48
|
-
label?: import("react").ReactNode;
|
|
49
|
-
selected?: boolean;
|
|
50
|
-
selectable?: boolean;
|
|
51
|
-
deletable?: boolean;
|
|
52
|
-
ariaLabel?: string;
|
|
53
|
-
focusable?: boolean;
|
|
54
41
|
sourceHandle?: string | null;
|
|
55
42
|
targetHandle?: string | null;
|
|
56
43
|
animated?: boolean;
|
|
44
|
+
hidden?: boolean;
|
|
45
|
+
deletable?: boolean;
|
|
46
|
+
selectable?: boolean;
|
|
47
|
+
selected?: boolean;
|
|
48
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
49
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
50
|
+
zIndex?: number;
|
|
51
|
+
ariaLabel?: string;
|
|
57
52
|
interactionWidth?: number;
|
|
53
|
+
label?: import("react").ReactNode;
|
|
58
54
|
labelStyle?: import("react").CSSProperties;
|
|
59
55
|
labelShowBg?: boolean;
|
|
60
56
|
labelBgStyle?: import("react").CSSProperties;
|
|
61
57
|
labelBgPadding?: [number, number];
|
|
62
58
|
labelBgBorderRadius?: number;
|
|
59
|
+
style?: import("react").CSSProperties;
|
|
60
|
+
className?: string;
|
|
63
61
|
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
62
|
+
focusable?: boolean;
|
|
64
63
|
data: import("../types").RelationshipData;
|
|
65
|
-
|
|
64
|
+
readonly id: string;
|
|
65
|
+
readonly type: "relationship";
|
|
66
66
|
}>;
|
|
67
67
|
setState: (partial: import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
68
68
|
source: string;
|
|
69
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
|
-
className?: string;
|
|
77
|
-
label?: import("react").ReactNode;
|
|
78
|
-
selected?: boolean;
|
|
79
|
-
selectable?: boolean;
|
|
80
|
-
deletable?: boolean;
|
|
81
|
-
ariaLabel?: string;
|
|
82
|
-
focusable?: boolean;
|
|
83
70
|
sourceHandle?: string | null;
|
|
84
71
|
targetHandle?: string | null;
|
|
85
72
|
animated?: boolean;
|
|
73
|
+
hidden?: boolean;
|
|
74
|
+
deletable?: boolean;
|
|
75
|
+
selectable?: boolean;
|
|
76
|
+
selected?: boolean;
|
|
77
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
78
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
79
|
+
zIndex?: number;
|
|
80
|
+
ariaLabel?: string;
|
|
86
81
|
interactionWidth?: number;
|
|
82
|
+
label?: import("react").ReactNode;
|
|
87
83
|
labelStyle?: import("react").CSSProperties;
|
|
88
84
|
labelShowBg?: boolean;
|
|
89
85
|
labelBgStyle?: import("react").CSSProperties;
|
|
90
86
|
labelBgPadding?: [number, number];
|
|
91
87
|
labelBgBorderRadius?: number;
|
|
88
|
+
style?: import("react").CSSProperties;
|
|
89
|
+
className?: string;
|
|
92
90
|
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
91
|
+
focusable?: boolean;
|
|
93
92
|
data: import("../types").RelationshipData;
|
|
94
|
-
|
|
93
|
+
readonly id: string;
|
|
94
|
+
readonly type: "relationship";
|
|
95
95
|
}> | Partial<import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
96
96
|
source: string;
|
|
97
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
|
-
className?: string;
|
|
105
|
-
label?: import("react").ReactNode;
|
|
106
|
-
selected?: boolean;
|
|
107
|
-
selectable?: boolean;
|
|
108
|
-
deletable?: boolean;
|
|
109
|
-
ariaLabel?: string;
|
|
110
|
-
focusable?: boolean;
|
|
111
98
|
sourceHandle?: string | null;
|
|
112
99
|
targetHandle?: string | null;
|
|
113
100
|
animated?: boolean;
|
|
101
|
+
hidden?: boolean;
|
|
102
|
+
deletable?: boolean;
|
|
103
|
+
selectable?: boolean;
|
|
104
|
+
selected?: boolean;
|
|
105
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
106
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
107
|
+
zIndex?: number;
|
|
108
|
+
ariaLabel?: string;
|
|
114
109
|
interactionWidth?: number;
|
|
110
|
+
label?: import("react").ReactNode;
|
|
115
111
|
labelStyle?: import("react").CSSProperties;
|
|
116
112
|
labelShowBg?: boolean;
|
|
117
113
|
labelBgStyle?: import("react").CSSProperties;
|
|
118
114
|
labelBgPadding?: [number, number];
|
|
119
115
|
labelBgBorderRadius?: number;
|
|
116
|
+
style?: import("react").CSSProperties;
|
|
117
|
+
className?: string;
|
|
120
118
|
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
119
|
+
focusable?: boolean;
|
|
121
120
|
data: import("../types").RelationshipData;
|
|
122
|
-
|
|
121
|
+
readonly id: string;
|
|
122
|
+
readonly type: "relationship";
|
|
123
123
|
}>> | ((state: import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
124
124
|
source: string;
|
|
125
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
|
-
className?: string;
|
|
133
|
-
label?: import("react").ReactNode;
|
|
134
|
-
selected?: boolean;
|
|
135
|
-
selectable?: boolean;
|
|
136
|
-
deletable?: boolean;
|
|
137
|
-
ariaLabel?: string;
|
|
138
|
-
focusable?: boolean;
|
|
139
126
|
sourceHandle?: string | null;
|
|
140
127
|
targetHandle?: string | null;
|
|
141
128
|
animated?: boolean;
|
|
129
|
+
hidden?: boolean;
|
|
130
|
+
deletable?: boolean;
|
|
131
|
+
selectable?: boolean;
|
|
132
|
+
selected?: boolean;
|
|
133
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
134
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
135
|
+
zIndex?: number;
|
|
136
|
+
ariaLabel?: string;
|
|
142
137
|
interactionWidth?: number;
|
|
138
|
+
label?: import("react").ReactNode;
|
|
143
139
|
labelStyle?: import("react").CSSProperties;
|
|
144
140
|
labelShowBg?: boolean;
|
|
145
141
|
labelBgStyle?: import("react").CSSProperties;
|
|
146
142
|
labelBgPadding?: [number, number];
|
|
147
143
|
labelBgBorderRadius?: number;
|
|
144
|
+
style?: import("react").CSSProperties;
|
|
145
|
+
className?: string;
|
|
148
146
|
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
147
|
+
focusable?: boolean;
|
|
149
148
|
data: import("../types").RelationshipData;
|
|
150
|
-
|
|
149
|
+
readonly id: string;
|
|
150
|
+
readonly type: "relationship";
|
|
151
151
|
}>) => import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
152
152
|
source: string;
|
|
153
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
|
-
className?: string;
|
|
161
|
-
label?: import("react").ReactNode;
|
|
162
|
-
selected?: boolean;
|
|
163
|
-
selectable?: boolean;
|
|
164
|
-
deletable?: boolean;
|
|
165
|
-
ariaLabel?: string;
|
|
166
|
-
focusable?: boolean;
|
|
167
154
|
sourceHandle?: string | null;
|
|
168
155
|
targetHandle?: string | null;
|
|
169
156
|
animated?: boolean;
|
|
157
|
+
hidden?: boolean;
|
|
158
|
+
deletable?: boolean;
|
|
159
|
+
selectable?: boolean;
|
|
160
|
+
selected?: boolean;
|
|
161
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
162
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
163
|
+
zIndex?: number;
|
|
164
|
+
ariaLabel?: string;
|
|
170
165
|
interactionWidth?: number;
|
|
166
|
+
label?: import("react").ReactNode;
|
|
171
167
|
labelStyle?: import("react").CSSProperties;
|
|
172
168
|
labelShowBg?: boolean;
|
|
173
169
|
labelBgStyle?: import("react").CSSProperties;
|
|
174
170
|
labelBgPadding?: [number, number];
|
|
175
171
|
labelBgBorderRadius?: number;
|
|
172
|
+
style?: import("react").CSSProperties;
|
|
173
|
+
className?: string;
|
|
176
174
|
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
175
|
+
focusable?: boolean;
|
|
177
176
|
data: import("../types").RelationshipData;
|
|
178
|
-
|
|
177
|
+
readonly id: string;
|
|
178
|
+
readonly type: "relationship";
|
|
179
179
|
}> | Partial<import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
180
180
|
source: string;
|
|
181
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
|
-
className?: string;
|
|
189
|
-
label?: import("react").ReactNode;
|
|
190
|
-
selected?: boolean;
|
|
191
|
-
selectable?: boolean;
|
|
192
|
-
deletable?: boolean;
|
|
193
|
-
ariaLabel?: string;
|
|
194
|
-
focusable?: boolean;
|
|
195
182
|
sourceHandle?: string | null;
|
|
196
183
|
targetHandle?: string | null;
|
|
197
184
|
animated?: boolean;
|
|
185
|
+
hidden?: boolean;
|
|
186
|
+
deletable?: boolean;
|
|
187
|
+
selectable?: boolean;
|
|
188
|
+
selected?: boolean;
|
|
189
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
190
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
191
|
+
zIndex?: number;
|
|
192
|
+
ariaLabel?: string;
|
|
198
193
|
interactionWidth?: number;
|
|
194
|
+
label?: import("react").ReactNode;
|
|
199
195
|
labelStyle?: import("react").CSSProperties;
|
|
200
196
|
labelShowBg?: boolean;
|
|
201
197
|
labelBgStyle?: import("react").CSSProperties;
|
|
202
198
|
labelBgPadding?: [number, number];
|
|
203
199
|
labelBgBorderRadius?: number;
|
|
200
|
+
style?: import("react").CSSProperties;
|
|
201
|
+
className?: string;
|
|
204
202
|
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
203
|
+
focusable?: boolean;
|
|
205
204
|
data: import("../types").RelationshipData;
|
|
206
|
-
|
|
205
|
+
readonly id: string;
|
|
206
|
+
readonly type: "relationship";
|
|
207
207
|
}>>), replace?: boolean | undefined) => void;
|
|
208
208
|
subscribe: (listener: (state: import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
209
209
|
source: string;
|
|
210
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
|
-
className?: string;
|
|
218
|
-
label?: import("react").ReactNode;
|
|
219
|
-
selected?: boolean;
|
|
220
|
-
selectable?: boolean;
|
|
221
|
-
deletable?: boolean;
|
|
222
|
-
ariaLabel?: string;
|
|
223
|
-
focusable?: boolean;
|
|
224
211
|
sourceHandle?: string | null;
|
|
225
212
|
targetHandle?: string | null;
|
|
226
213
|
animated?: boolean;
|
|
214
|
+
hidden?: boolean;
|
|
215
|
+
deletable?: boolean;
|
|
216
|
+
selectable?: boolean;
|
|
217
|
+
selected?: boolean;
|
|
218
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
219
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
220
|
+
zIndex?: number;
|
|
221
|
+
ariaLabel?: string;
|
|
227
222
|
interactionWidth?: number;
|
|
223
|
+
label?: import("react").ReactNode;
|
|
228
224
|
labelStyle?: import("react").CSSProperties;
|
|
229
225
|
labelShowBg?: boolean;
|
|
230
226
|
labelBgStyle?: import("react").CSSProperties;
|
|
231
227
|
labelBgPadding?: [number, number];
|
|
232
228
|
labelBgBorderRadius?: number;
|
|
229
|
+
style?: import("react").CSSProperties;
|
|
230
|
+
className?: string;
|
|
233
231
|
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
232
|
+
focusable?: boolean;
|
|
234
233
|
data: import("../types").RelationshipData;
|
|
235
|
-
|
|
234
|
+
readonly id: string;
|
|
235
|
+
readonly type: "relationship";
|
|
236
236
|
}>, prevState: import('@xyflow/react').ReactFlowState<XYFlowNode, {
|
|
237
237
|
source: string;
|
|
238
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
|
-
className?: string;
|
|
246
|
-
label?: import("react").ReactNode;
|
|
247
|
-
selected?: boolean;
|
|
248
|
-
selectable?: boolean;
|
|
249
|
-
deletable?: boolean;
|
|
250
|
-
ariaLabel?: string;
|
|
251
|
-
focusable?: boolean;
|
|
252
239
|
sourceHandle?: string | null;
|
|
253
240
|
targetHandle?: string | null;
|
|
254
241
|
animated?: boolean;
|
|
242
|
+
hidden?: boolean;
|
|
243
|
+
deletable?: boolean;
|
|
244
|
+
selectable?: boolean;
|
|
245
|
+
selected?: boolean;
|
|
246
|
+
markerStart?: import("@xyflow/react").EdgeMarkerType;
|
|
247
|
+
markerEnd?: import("@xyflow/react").EdgeMarkerType;
|
|
248
|
+
zIndex?: number;
|
|
249
|
+
ariaLabel?: string;
|
|
255
250
|
interactionWidth?: number;
|
|
251
|
+
label?: import("react").ReactNode;
|
|
256
252
|
labelStyle?: import("react").CSSProperties;
|
|
257
253
|
labelShowBg?: boolean;
|
|
258
254
|
labelBgStyle?: import("react").CSSProperties;
|
|
259
255
|
labelBgPadding?: [number, number];
|
|
260
256
|
labelBgBorderRadius?: number;
|
|
257
|
+
style?: import("react").CSSProperties;
|
|
258
|
+
className?: string;
|
|
261
259
|
updatable?: import("@xyflow/react").EdgeUpdatable;
|
|
260
|
+
focusable?: boolean;
|
|
262
261
|
data: import("../types").RelationshipData;
|
|
263
|
-
|
|
262
|
+
readonly id: string;
|
|
263
|
+
readonly type: "relationship";
|
|
264
264
|
}>) => void) => () => void;
|
|
265
265
|
};
|
|
266
266
|
export type XYStoreApi = ReturnType<typeof useXYStoreApi>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const container: string;
|
|
2
|
+
export declare const dimmed: string;
|
|
2
3
|
export declare const varTransparency: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
3
4
|
export declare const compoundBody: string;
|
|
4
5
|
export declare const transparent: string;
|
|
@@ -6,5 +6,5 @@ type ElementIconProps = {
|
|
|
6
6
|
paddingX?: number | undefined;
|
|
7
7
|
paddingY?: number | undefined;
|
|
8
8
|
};
|
|
9
|
-
export declare function ElementIcon({ node, paddingY }: ElementIconProps): JSX.Element | null;
|
|
9
|
+
export declare function ElementIcon({ node, paddingY }: ElementIconProps): import("react/jsx-runtime").JSX.Element | null;
|
|
10
10
|
export {};
|
|
@@ -3,5 +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): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -2,5 +2,5 @@ import { ElementXYFlowNode } from '../../types';
|
|
|
2
2
|
import { NodeProps } from '@xyflow/react';
|
|
3
3
|
|
|
4
4
|
type ElementNodeProps = NodeProps<ElementXYFlowNode>;
|
|
5
|
-
export declare function ElementNode({ id, data: { element }, dragging, selected, width, height }: ElementNodeProps): JSX.Element;
|
|
5
|
+
export declare function ElementNode({ id, data: { element }, dragging, selected, width, height }: ElementNodeProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -5,9 +5,9 @@ type ElementShapeSvgProps = {
|
|
|
5
5
|
w: number;
|
|
6
6
|
h: number;
|
|
7
7
|
};
|
|
8
|
-
export declare function ElementShapeSvg({ shape, w, h }: ElementShapeSvgProps): JSX.Element;
|
|
8
|
+
export declare function ElementShapeSvg({ shape, w, h }: ElementShapeSvgProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
/**
|
|
10
10
|
* When element is selected, this component is used to render the indicator
|
|
11
11
|
*/
|
|
12
|
-
export declare function SelectedIndicator({ shape, w, h }: ElementShapeSvgProps): JSX.Element;
|
|
12
|
+
export declare function SelectedIndicator({ shape, w, h }: ElementShapeSvgProps): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const stokeFillMix: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
2
2
|
export declare const container: string;
|
|
3
|
+
export declare const dimmed: string;
|
|
3
4
|
export declare const indicator: string;
|
|
4
5
|
export declare const fillElementFill: string;
|
|
5
6
|
export declare const fillElementStroke: string;
|
|
@@ -7,7 +8,7 @@ export declare const fillMixStroke: string;
|
|
|
7
8
|
export declare const title: string;
|
|
8
9
|
export declare const description: string;
|
|
9
10
|
export declare const technology: string;
|
|
10
|
-
export declare const
|
|
11
|
+
export declare const element: string;
|
|
11
12
|
export declare const iconMaxH: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
12
13
|
export declare const elementIcon: string;
|
|
13
14
|
export declare const cssShapeSvg: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export type NavigateToBtnProps = {
|
|
3
2
|
xynodeId: string;
|
|
4
3
|
className?: string;
|
|
5
4
|
};
|
|
6
|
-
export declare function NavigateToBtn({ xynodeId, className }: NavigateToBtnProps): JSX.Element;
|
|
5
|
+
export declare function NavigateToBtn({ xynodeId, className }: NavigateToBtnProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/xyflow/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SetReadonly, SetRequired
|
|
1
|
+
import { SetReadonly, SetRequired } from 'type-fest';
|
|
2
2
|
import { MouseEvent as ReactMouseEvent } from 'react';
|
|
3
3
|
import { Edge, EdgeMouseHandler, InternalNode, Node, NodeMouseHandler, OnMoveEnd, OnMoveStart, ReactFlowInstance, ReactFlowState } from '@xyflow/react';
|
|
4
4
|
import { BBox, DiagramEdge, DiagramNode, Fqn, Point } from '@likec4/core';
|
|
@@ -8,6 +8,7 @@ export type ElementNodeData = {
|
|
|
8
8
|
element: DiagramNode;
|
|
9
9
|
};
|
|
10
10
|
type TypedXYFlowNode<D extends Record<string, unknown>, T extends string> = SetReadonly<SetRequired<Node<D, T>, 'type'>, 'id' | 'type'>;
|
|
11
|
+
type TypedXYFlowEdge<D extends Record<string, unknown>, T extends string> = SetReadonly<SetRequired<Edge<D, T>, 'type' | 'data'>, 'id' | 'type'>;
|
|
11
12
|
export type ElementXYFlowNode = TypedXYFlowNode<ElementNodeData, 'element'>;
|
|
12
13
|
export type CompoundNodeData = {
|
|
13
14
|
fqn: Fqn;
|
|
@@ -28,45 +29,44 @@ export type RelationshipData = {
|
|
|
28
29
|
headPoint: Point | null;
|
|
29
30
|
tailPoint: Point | null;
|
|
30
31
|
type: 'bezier' | 'poly';
|
|
32
|
+
stepNum: number | null;
|
|
31
33
|
label: null | {
|
|
32
34
|
bbox: BBox;
|
|
33
35
|
text: string;
|
|
34
36
|
};
|
|
35
37
|
};
|
|
36
|
-
export type RelationshipEdge =
|
|
37
|
-
type: 'relationship';
|
|
38
|
-
}>;
|
|
38
|
+
export type RelationshipEdge = TypedXYFlowEdge<RelationshipData, 'relationship'>;
|
|
39
39
|
export type XYFlowEdge = RelationshipEdge;
|
|
40
40
|
export declare namespace XYFlowEdge {
|
|
41
41
|
type Data = RelationshipData;
|
|
42
42
|
const isRelationship: (e: Edge) => e is {
|
|
43
43
|
source: string;
|
|
44
44
|
target: string;
|
|
45
|
-
style?: import('react').CSSProperties;
|
|
46
|
-
id: string;
|
|
47
|
-
zIndex?: number;
|
|
48
|
-
markerEnd?: import('@xyflow/react').EdgeMarkerType;
|
|
49
|
-
markerStart?: import('@xyflow/react').EdgeMarkerType;
|
|
50
|
-
hidden?: boolean;
|
|
51
|
-
className?: string;
|
|
52
|
-
label?: import('react').ReactNode;
|
|
53
|
-
selected?: boolean;
|
|
54
|
-
selectable?: boolean;
|
|
55
|
-
deletable?: boolean;
|
|
56
|
-
ariaLabel?: string;
|
|
57
|
-
focusable?: boolean;
|
|
58
45
|
sourceHandle?: string | null;
|
|
59
46
|
targetHandle?: string | null;
|
|
60
47
|
animated?: boolean;
|
|
48
|
+
hidden?: boolean;
|
|
49
|
+
deletable?: boolean;
|
|
50
|
+
selectable?: boolean;
|
|
51
|
+
selected?: boolean;
|
|
52
|
+
markerStart?: import('@xyflow/react').EdgeMarkerType;
|
|
53
|
+
markerEnd?: import('@xyflow/react').EdgeMarkerType;
|
|
54
|
+
zIndex?: number;
|
|
55
|
+
ariaLabel?: string;
|
|
61
56
|
interactionWidth?: number;
|
|
57
|
+
label?: import('react').ReactNode;
|
|
62
58
|
labelStyle?: import('react').CSSProperties;
|
|
63
59
|
labelShowBg?: boolean;
|
|
64
60
|
labelBgStyle?: import('react').CSSProperties;
|
|
65
61
|
labelBgPadding?: [number, number];
|
|
66
62
|
labelBgBorderRadius?: number;
|
|
63
|
+
style?: import('react').CSSProperties;
|
|
64
|
+
className?: string;
|
|
67
65
|
updatable?: import('@xyflow/react').EdgeUpdatable;
|
|
66
|
+
focusable?: boolean;
|
|
68
67
|
data: RelationshipData;
|
|
69
|
-
|
|
68
|
+
readonly id: string;
|
|
69
|
+
readonly type: "relationship";
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
export type XYFlowInstance = ReactFlowInstance<XYFlowNode, XYFlowEdge>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/diagram",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
6
6
|
"homepage": "https://likec4.dev",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"./style.css": "./dist/style.css"
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
"packageManager": "yarn@4.
|
|
43
|
+
"packageManager": "yarn@4.3.0",
|
|
44
44
|
"scripts": {
|
|
45
|
-
"typecheck": "tsc",
|
|
45
|
+
"typecheck": "tsc -b",
|
|
46
46
|
"prepack": "vite build --mode production",
|
|
47
47
|
"build:turbo": "run -T turbo build --filter='diagram'",
|
|
48
48
|
"build": "vite build --mode development && tsc -b",
|
|
@@ -50,8 +50,9 @@
|
|
|
50
50
|
"clean": "run -T rimraf -v -g 'dist/*' .tsbuildinfo"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@likec4/core": "1.
|
|
53
|
+
"@likec4/core": "1.2.0",
|
|
54
54
|
"@react-hookz/web": "^24.0.4",
|
|
55
|
+
"@tabler/icons-react": "^3.0.0",
|
|
55
56
|
"d3-shape": "^3.2.0",
|
|
56
57
|
"esm-env": "^1.0.0",
|
|
57
58
|
"fast-equals": "^5.0.1",
|
|
@@ -60,30 +61,32 @@
|
|
|
60
61
|
"zustand": "^4.5.2"
|
|
61
62
|
},
|
|
62
63
|
"peerDependencies": {
|
|
63
|
-
"@mantine/core": "^7.
|
|
64
|
-
"@mantine/hooks": "^7.
|
|
64
|
+
"@mantine/core": "^7.10.1",
|
|
65
|
+
"@mantine/hooks": "^7.10.1",
|
|
65
66
|
"react": "^18.3.1",
|
|
66
67
|
"react-dom": "^18.3.1"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"@lume/kiwi": "^0.4.3",
|
|
70
|
-
"@mantine/core": "^7.
|
|
71
|
-
"@mantine/hooks": "^7.
|
|
72
|
-
"@mantine/vanilla-extract": "^7.
|
|
71
|
+
"@mantine/core": "^7.10.1",
|
|
72
|
+
"@mantine/hooks": "^7.10.1",
|
|
73
|
+
"@mantine/vanilla-extract": "^7.10.1",
|
|
73
74
|
"@total-typescript/ts-reset": "^0.5.1",
|
|
75
|
+
"@types/bezier-js": "^4.1.3",
|
|
74
76
|
"@types/d3-shape": "^3",
|
|
75
|
-
"@types/react": "18.
|
|
76
|
-
"@types/react-dom": "18.
|
|
77
|
-
"@vanilla-extract/css": "^1.15.
|
|
78
|
-
"@vanilla-extract/dynamic": "^2.1.
|
|
79
|
-
"@vanilla-extract/esbuild-plugin": "^2.3.
|
|
77
|
+
"@types/react": "^18.3.3",
|
|
78
|
+
"@types/react-dom": "^18.3.0",
|
|
79
|
+
"@vanilla-extract/css": "^1.15.2",
|
|
80
|
+
"@vanilla-extract/dynamic": "^2.1.1",
|
|
81
|
+
"@vanilla-extract/esbuild-plugin": "^2.3.6",
|
|
80
82
|
"@vitejs/plugin-react": "^4.2.1",
|
|
81
83
|
"@xyflow/react": "^12.0.0-next",
|
|
84
|
+
"bezier-js": "^6.1.4",
|
|
82
85
|
"clsx": "^2.1.1",
|
|
83
86
|
"execa": "^9.1.0",
|
|
84
87
|
"khroma": "^2.1.0",
|
|
85
|
-
"react": "^18.
|
|
86
|
-
"react-dom": "^18.
|
|
88
|
+
"react": "^18.3.1",
|
|
89
|
+
"react-dom": "^18.3.1",
|
|
87
90
|
"tilg": "^0.1.1",
|
|
88
91
|
"type-fest": "^4.18.2",
|
|
89
92
|
"typescript": "^5.4.5",
|
package/src/LikeC4Diagram.css.ts
CHANGED
|
@@ -11,8 +11,8 @@ import type {
|
|
|
11
11
|
} from '@likec4/core'
|
|
12
12
|
import type { MouseEvent as ReactMouseEvent } from 'react'
|
|
13
13
|
import type { SetRequired, Simplify } from 'type-fest'
|
|
14
|
-
import type { XYBackgroundProps } from './xyflow/XYFlowBackground'
|
|
15
14
|
import type { XYFlowEdge, XYFlowNode } from './xyflow/types'
|
|
15
|
+
import type { XYBackground, XYBackgroundProps } from './xyflow/XYFlowBackground'
|
|
16
16
|
|
|
17
17
|
export type DiagramNodeWithNavigate = Simplify<SetRequired<DiagramNode, 'navigateTo'>>
|
|
18
18
|
|
|
@@ -57,8 +57,7 @@ export namespace Changes {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
export type Change =
|
|
61
|
-
| Changes.ChangeElementStyle
|
|
60
|
+
export type Change = Changes.ChangeElementStyle
|
|
62
61
|
|
|
63
62
|
export type ChangeEvent = {
|
|
64
63
|
changes: NonEmptyArray<Change>
|
|
@@ -131,7 +130,7 @@ export interface LikeC4DiagramProperties {
|
|
|
131
130
|
* Background pattern
|
|
132
131
|
* @default 'dots'
|
|
133
132
|
*/
|
|
134
|
-
background?: 'transparent' | 'solid' |
|
|
133
|
+
background?: 'transparent' | 'solid' | XYBackground | undefined
|
|
135
134
|
|
|
136
135
|
/**
|
|
137
136
|
* Display hovercards with element links
|
|
@@ -144,6 +143,12 @@ export interface LikeC4DiagramProperties {
|
|
|
144
143
|
* @default true
|
|
145
144
|
*/
|
|
146
145
|
showDiagramTitle?: boolean | undefined
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* If Walkthrough for dynamic views should be enabled
|
|
149
|
+
* @default false
|
|
150
|
+
*/
|
|
151
|
+
enableDynamicViewWalkthrough?: boolean | undefined
|
|
147
152
|
}
|
|
148
153
|
|
|
149
154
|
export interface LikeC4DiagramEventHandlers {
|