@likec4/diagram 1.44.0 → 1.45.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/bundle/index.js +18160 -17671
- package/dist/LikeC4Diagram.js +7 -5
- package/dist/LikeC4Diagram.props.d.ts +9 -8
- package/dist/LikeC4Styles.js +0 -3
- package/dist/LikeC4View.d.ts +3 -3
- package/dist/LikeC4View.js +7 -3
- package/dist/ReactLikeC4.d.ts +2 -2
- package/dist/base/Base.d.ts +1 -1
- package/dist/base/updateEdges.js +25 -15
- package/dist/base/updateNodes.d.ts +14 -0
- package/dist/base/updateNodes.js +51 -18
- package/dist/base-primitives/Markdown.d.ts +30 -4
- package/dist/base-primitives/Markdown.js +3 -2
- package/dist/base-primitives/compound/CompoundActionButton.d.ts +3 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +3 -2
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +3 -2
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +4 -1
- package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -2
- package/dist/base-primitives/edge/EdgePath.js +24 -4
- package/dist/base-primitives/element/ElementActionButtons.d.ts +3 -2
- package/dist/base-primitives/element/ElementActionButtons.js +2 -2
- package/dist/base-primitives/element/ElementData.d.ts +3 -3
- package/dist/base-primitives/element/ElementData.js +13 -7
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +3 -2
- package/dist/base-primitives/element/ElementDetailsButton.js +3 -0
- package/dist/base-primitives/element/ElementShape.js +5 -5
- package/dist/base-primitives/element/ElementTags.d.ts +6 -4
- package/dist/context/DiagramFeatures.d.ts +1 -0
- package/dist/context/TagStylesContext.js +1 -1
- package/dist/custom/hooks.d.ts +2 -2
- package/dist/custom/index.js +1 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/useDiagramCompareLayout.js +7 -2
- package/dist/hooks/useLikeC4Project.d.ts +6 -1
- package/dist/hooks/useLikeC4Project.js +14 -2
- package/dist/hooks/useMediaPrint.d.ts +6 -0
- package/dist/likec4diagram/DiagramXYFlow.js +11 -6
- package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/edges/EdgeDrifts.js +38 -0
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +24 -14
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +3 -1
- package/dist/likec4diagram/custom/edges/useControlPoints.js +3 -3
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +5 -5
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/{ElementNodeDrifts.js → NodeDrifts.js} +8 -4
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -2
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.js +64 -23
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +3 -3
- package/dist/likec4diagram/relationship-popover/actor.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +2 -2
- package/dist/likec4diagram/state/DiagramActorProvider.js +0 -1
- package/dist/likec4diagram/state/assign.d.ts +10 -6
- package/dist/likec4diagram/state/assign.js +17 -192
- package/dist/likec4diagram/state/createViewChange.js +15 -26
- package/dist/likec4diagram/state/diagram-api.d.ts +2 -6
- package/dist/likec4diagram/state/diagram-api.js +2 -10
- package/dist/likec4diagram/state/hotkeyActor.d.ts +0 -7
- package/dist/likec4diagram/state/hotkeyActor.js +1 -17
- package/dist/likec4diagram/state/machine.actions.d.ts +430 -746
- package/dist/likec4diagram/state/machine.actions.js +193 -284
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +579 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +129 -0
- package/dist/likec4diagram/state/machine.d.ts +17 -3712
- package/dist/likec4diagram/state/machine.js +59 -73
- package/dist/likec4diagram/state/machine.setup.d.ts +61 -18
- package/dist/likec4diagram/state/machine.setup.js +27 -5
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +25 -0
- package/dist/likec4diagram/state/machine.state.initializing.js +5 -5
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +5 -108
- package/dist/likec4diagram/state/machine.state.navigating.js +167 -34
- package/dist/likec4diagram/state/machine.state.ready.d.ts +2316 -2851
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +386 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.js +85 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +474 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.js +96 -0
- package/dist/likec4diagram/state/machine.state.ready.js +144 -319
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +128 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +40 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +511 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +177 -0
- package/dist/likec4diagram/state/mediaPrintActor.d.ts +12 -0
- package/dist/likec4diagram/state/mediaPrintActor.js +18 -0
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +6 -240
- package/dist/likec4diagram/state/syncManualLayoutActor.js +150 -89
- package/dist/likec4diagram/state/types.d.ts +5 -7
- package/dist/likec4diagram/state/utils.d.ts +15 -2
- package/dist/likec4diagram/state/utils.js +43 -3
- package/dist/likec4diagram/types.d.ts +8 -13
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -2
- package/dist/likec4diagram/useLayoutConstraints.js +107 -102
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +12 -15
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +11 -8
- package/dist/navigationpanel/NavigationPanel.js +5 -1
- package/dist/navigationpanel/actor.d.ts +4 -204
- package/dist/navigationpanel/actor.js +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +8 -3
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +66 -66
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +4 -3
- package/dist/overlays/element-details/ElementDetailsCard.css.js +3 -3
- package/dist/overlays/element-details/MetadataValue.d.ts +2 -1
- package/dist/overlays/element-details/actor.d.ts +8 -83
- package/dist/overlays/element-details/actor.js +0 -8
- package/dist/overlays/overlay/Overlay.js +10 -10
- package/dist/overlays/overlaysActor.d.ts +7 -392
- package/dist/overlays/overlaysActor.js +67 -46
- package/dist/overlays/relationship-details/_types.d.ts +3 -4
- package/dist/overlays/relationship-details/actor.d.ts +6 -562
- package/dist/overlays/relationship-details/actor.js +1 -0
- package/dist/overlays/relationship-details/layout-to-xyflow.js +3 -5
- package/dist/overlays/relationship-details/layout.d.ts +3 -3
- package/dist/overlays/relationship-details/layout.js +4 -4
- package/dist/overlays/relationships-browser/_types.d.ts +2 -3
- package/dist/overlays/relationships-browser/actor.d.ts +7 -739
- package/dist/overlays/relationships-browser/layout.d.ts +2 -2
- package/dist/overlays/relationships-browser/layout.js +3 -3
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +0 -3
- package/dist/overlays/types.d.ts +12 -13
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/searchActor.d.ts +3 -66
- package/dist/shadowroot/ShadowRoot.d.ts +5 -7
- package/dist/shadowroot/ShadowRoot.js +7 -5
- package/dist/styles.css2.js +1 -1
- package/dist/utils/vector.d.ts +5 -0
- package/dist/utils/vector.js +7 -0
- package/dist/utils/view-bounds.js +7 -6
- package/dist/utils/xyflow.d.ts +4 -2
- package/dist/utils/xyflow.js +18 -50
- package/package.json +19 -18
- package/panda.buildinfo.json +17 -5
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.d.ts +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BBox, EdgeId, ExclusiveUnion, Fqn, ViewId } from '@likec4/core';
|
|
2
2
|
import { EdgeChange, NodeChange, ReactFlowInstance, ReactFlowState } from '@xyflow/react';
|
|
3
|
-
import {
|
|
3
|
+
import { ActorRef, SnapshotFrom, StateMachine } from 'xstate';
|
|
4
4
|
import { RelationshipDetailsTypes } from './_types';
|
|
5
5
|
import { LayoutResult } from './layout';
|
|
6
6
|
type XYFLowInstance = ReactFlowInstance<RelationshipDetailsTypes.AnyNode, RelationshipDetailsTypes.Edge>;
|
|
@@ -99,567 +99,11 @@ export type Events = {
|
|
|
99
99
|
} | {
|
|
100
100
|
type: 'close';
|
|
101
101
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
viewId: ViewId;
|
|
105
|
-
xyflow: XYFLowInstance | null;
|
|
106
|
-
xystore: XYStoreApi | null;
|
|
107
|
-
initialized: {
|
|
108
|
-
xydata: boolean;
|
|
109
|
-
xyflow: boolean;
|
|
110
|
-
};
|
|
111
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
112
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
113
|
-
bounds: BBox;
|
|
114
|
-
}>, Events, {}, never, Values<{
|
|
115
|
-
"xyflow:fitDiagram": {
|
|
116
|
-
type: "xyflow:fitDiagram";
|
|
117
|
-
params: {
|
|
118
|
-
duration?: number;
|
|
119
|
-
bounds?: BBox;
|
|
120
|
-
} | undefined;
|
|
121
|
-
};
|
|
122
|
-
"xyflow:updateNodeInternals": {
|
|
123
|
-
type: "xyflow:updateNodeInternals";
|
|
124
|
-
params: unknown;
|
|
125
|
-
};
|
|
126
|
-
updateXYFlow: {
|
|
127
|
-
type: "updateXYFlow";
|
|
128
|
-
params: NonReducibleUnknown;
|
|
129
|
-
};
|
|
130
|
-
updateLayoutData: {
|
|
131
|
-
type: "updateLayoutData";
|
|
132
|
-
params: NonReducibleUnknown;
|
|
133
|
-
};
|
|
134
|
-
"open relationship source": {
|
|
135
|
-
type: "open relationship source";
|
|
136
|
-
params: NonReducibleUnknown;
|
|
137
|
-
};
|
|
138
|
-
}>, Values<{
|
|
139
|
-
isReady: {
|
|
140
|
-
type: "isReady";
|
|
141
|
-
params: unknown;
|
|
142
|
-
};
|
|
143
|
-
"enable: navigate.to": {
|
|
144
|
-
type: "enable: navigate.to";
|
|
145
|
-
params: unknown;
|
|
146
|
-
};
|
|
147
|
-
}>, never, "ready" | "closed" | "isReady" | "initializing", string, {
|
|
148
|
-
target?: never;
|
|
149
|
-
source?: never;
|
|
150
|
-
edgeId: EdgeId;
|
|
151
|
-
viewId: ViewId;
|
|
152
|
-
} | {
|
|
153
|
-
edgeId?: never;
|
|
154
|
-
source: Fqn;
|
|
155
|
-
target: Fqn;
|
|
156
|
-
viewId: ViewId;
|
|
157
|
-
}, NonReducibleUnknown, EventObject, MetaObject, {
|
|
158
|
-
readonly initial: "initializing";
|
|
159
|
-
readonly context: ({ input }: {
|
|
160
|
-
spawn: {
|
|
161
|
-
<TSrc extends never>(logic: TSrc, ...[options]: never): ActorRefFromLogic<never>;
|
|
162
|
-
<TLogic extends AnyActorLogic>(src: TLogic, ...[options]: ConditionalRequired<[options?: {
|
|
163
|
-
id?: never;
|
|
164
|
-
systemId?: string;
|
|
165
|
-
input?: InputFrom<TLogic>;
|
|
166
|
-
syncSnapshot?: boolean;
|
|
167
|
-
} & { [K in RequiredLogicInput<TLogic>]: unknown; }], IsNotNever<RequiredLogicInput<TLogic>>>): ActorRefFromLogic<TLogic>;
|
|
168
|
-
};
|
|
169
|
-
input: {
|
|
170
|
-
target?: never;
|
|
171
|
-
source?: never;
|
|
172
|
-
edgeId: EdgeId;
|
|
173
|
-
viewId: ViewId;
|
|
174
|
-
} | {
|
|
175
|
-
edgeId?: never;
|
|
176
|
-
source: Fqn;
|
|
177
|
-
target: Fqn;
|
|
178
|
-
viewId: ViewId;
|
|
179
|
-
};
|
|
180
|
-
self: ActorRef<MachineSnapshot<Readonly<{
|
|
181
|
-
subject: Subject;
|
|
182
|
-
viewId: ViewId;
|
|
183
|
-
xyflow: XYFLowInstance | null;
|
|
184
|
-
xystore: XYStoreApi | null;
|
|
185
|
-
initialized: {
|
|
186
|
-
xydata: boolean;
|
|
187
|
-
xyflow: boolean;
|
|
188
|
-
};
|
|
189
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
190
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
191
|
-
bounds: BBox;
|
|
192
|
-
}>, Events, Record<string, AnyActorRef | undefined>, StateValue, string, unknown, any, any>, Events, AnyEventObject>;
|
|
193
|
-
}) => {
|
|
194
|
-
subject: Subject;
|
|
195
|
-
viewId: ViewId;
|
|
196
|
-
bounds: {
|
|
197
|
-
x: number;
|
|
198
|
-
y: number;
|
|
199
|
-
width: number;
|
|
200
|
-
height: number;
|
|
201
|
-
};
|
|
202
|
-
initialized: {
|
|
203
|
-
xydata: false;
|
|
204
|
-
xyflow: false;
|
|
205
|
-
};
|
|
206
|
-
xyflow: null;
|
|
207
|
-
xystore: null;
|
|
208
|
-
xynodes: never[];
|
|
209
|
-
xyedges: never[];
|
|
210
|
-
};
|
|
211
|
-
readonly states: {
|
|
212
|
-
readonly initializing: {
|
|
213
|
-
readonly on: {
|
|
214
|
-
readonly 'xyflow.init': {
|
|
215
|
-
readonly actions: "updateXYFlow";
|
|
216
|
-
readonly target: "isReady";
|
|
217
|
-
};
|
|
218
|
-
readonly 'update.layoutData': {
|
|
219
|
-
readonly actions: "updateLayoutData";
|
|
220
|
-
readonly target: "isReady";
|
|
221
|
-
};
|
|
222
|
-
readonly close: {
|
|
223
|
-
readonly target: "closed";
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
readonly isReady: {
|
|
228
|
-
readonly always: readonly [{
|
|
229
|
-
readonly guard: "isReady";
|
|
230
|
-
readonly actions: readonly [{
|
|
231
|
-
readonly type: "xyflow:fitDiagram";
|
|
232
|
-
readonly params: {
|
|
233
|
-
readonly duration: 0;
|
|
234
|
-
};
|
|
235
|
-
}, ActionFunction<Readonly<{
|
|
236
|
-
subject: Subject;
|
|
237
|
-
viewId: ViewId;
|
|
238
|
-
xyflow: XYFLowInstance | null;
|
|
239
|
-
xystore: XYStoreApi | null;
|
|
240
|
-
initialized: {
|
|
241
|
-
xydata: boolean;
|
|
242
|
-
xyflow: boolean;
|
|
243
|
-
};
|
|
244
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
245
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
246
|
-
bounds: BBox;
|
|
247
|
-
}>, Events, Events, undefined, never, never, never, never, never>];
|
|
248
|
-
readonly target: "ready";
|
|
249
|
-
}, {
|
|
250
|
-
readonly target: "initializing";
|
|
251
|
-
}];
|
|
252
|
-
};
|
|
253
|
-
readonly ready: {
|
|
254
|
-
readonly on: {
|
|
255
|
-
readonly 'xyflow.edgeMouseEnter': {
|
|
256
|
-
readonly actions: readonly [ ActionFunction<Readonly<{
|
|
257
|
-
subject: Subject;
|
|
258
|
-
viewId: ViewId;
|
|
259
|
-
xyflow: XYFLowInstance | null;
|
|
260
|
-
xystore: XYStoreApi | null;
|
|
261
|
-
initialized: {
|
|
262
|
-
xydata: boolean;
|
|
263
|
-
xyflow: boolean;
|
|
264
|
-
};
|
|
265
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
266
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
267
|
-
bounds: BBox;
|
|
268
|
-
}>, {
|
|
269
|
-
type: "xyflow.edgeMouseEnter";
|
|
270
|
-
edge: RelationshipDetailsTypes.Edge;
|
|
271
|
-
}, Events, undefined, never, never, never, never, never>, CancelAction<Readonly<{
|
|
272
|
-
subject: Subject;
|
|
273
|
-
viewId: ViewId;
|
|
274
|
-
xyflow: XYFLowInstance | null;
|
|
275
|
-
xystore: XYStoreApi | null;
|
|
276
|
-
initialized: {
|
|
277
|
-
xydata: boolean;
|
|
278
|
-
xyflow: boolean;
|
|
279
|
-
};
|
|
280
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
281
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
282
|
-
bounds: BBox;
|
|
283
|
-
}>, {
|
|
284
|
-
type: "xyflow.edgeMouseEnter";
|
|
285
|
-
edge: RelationshipDetailsTypes.Edge;
|
|
286
|
-
}, undefined, Events>, CancelAction<Readonly<{
|
|
287
|
-
subject: Subject;
|
|
288
|
-
viewId: ViewId;
|
|
289
|
-
xyflow: XYFLowInstance | null;
|
|
290
|
-
xystore: XYStoreApi | null;
|
|
291
|
-
initialized: {
|
|
292
|
-
xydata: boolean;
|
|
293
|
-
xyflow: boolean;
|
|
294
|
-
};
|
|
295
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
296
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
297
|
-
bounds: BBox;
|
|
298
|
-
}>, {
|
|
299
|
-
type: "xyflow.edgeMouseEnter";
|
|
300
|
-
edge: RelationshipDetailsTypes.Edge;
|
|
301
|
-
}, undefined, Events>, ActionFunction<Readonly<{
|
|
302
|
-
subject: Subject;
|
|
303
|
-
viewId: ViewId;
|
|
304
|
-
xyflow: XYFLowInstance | null;
|
|
305
|
-
xystore: XYStoreApi | null;
|
|
306
|
-
initialized: {
|
|
307
|
-
xydata: boolean;
|
|
308
|
-
xyflow: boolean;
|
|
309
|
-
};
|
|
310
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
311
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
312
|
-
bounds: BBox;
|
|
313
|
-
}>, {
|
|
314
|
-
type: "xyflow.edgeMouseEnter";
|
|
315
|
-
edge: RelationshipDetailsTypes.Edge;
|
|
316
|
-
}, Events, undefined, never, never, never, never, never>];
|
|
317
|
-
};
|
|
318
|
-
readonly 'xyflow.edgeMouseLeave': {
|
|
319
|
-
readonly actions: readonly [ ActionFunction<Readonly<{
|
|
320
|
-
subject: Subject;
|
|
321
|
-
viewId: ViewId;
|
|
322
|
-
xyflow: XYFLowInstance | null;
|
|
323
|
-
xystore: XYStoreApi | null;
|
|
324
|
-
initialized: {
|
|
325
|
-
xydata: boolean;
|
|
326
|
-
xyflow: boolean;
|
|
327
|
-
};
|
|
328
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
329
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
330
|
-
bounds: BBox;
|
|
331
|
-
}>, {
|
|
332
|
-
type: "xyflow.edgeMouseLeave";
|
|
333
|
-
edge: RelationshipDetailsTypes.Edge;
|
|
334
|
-
}, Events, undefined, never, never, never, never, never>, CancelAction<Readonly<{
|
|
335
|
-
subject: Subject;
|
|
336
|
-
viewId: ViewId;
|
|
337
|
-
xyflow: XYFLowInstance | null;
|
|
338
|
-
xystore: XYStoreApi | null;
|
|
339
|
-
initialized: {
|
|
340
|
-
xydata: boolean;
|
|
341
|
-
xyflow: boolean;
|
|
342
|
-
};
|
|
343
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
344
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
345
|
-
bounds: BBox;
|
|
346
|
-
}>, {
|
|
347
|
-
type: "xyflow.edgeMouseLeave";
|
|
348
|
-
edge: RelationshipDetailsTypes.Edge;
|
|
349
|
-
}, undefined, Events>, ActionFunction<Readonly<{
|
|
350
|
-
subject: Subject;
|
|
351
|
-
viewId: ViewId;
|
|
352
|
-
xyflow: XYFLowInstance | null;
|
|
353
|
-
xystore: XYStoreApi | null;
|
|
354
|
-
initialized: {
|
|
355
|
-
xydata: boolean;
|
|
356
|
-
xyflow: boolean;
|
|
357
|
-
};
|
|
358
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
359
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
360
|
-
bounds: BBox;
|
|
361
|
-
}>, {
|
|
362
|
-
type: "xyflow.edgeMouseLeave";
|
|
363
|
-
edge: RelationshipDetailsTypes.Edge;
|
|
364
|
-
}, Events, undefined, never, never, never, never, never>];
|
|
365
|
-
};
|
|
366
|
-
readonly 'dim.nonhovered.edges': {
|
|
367
|
-
readonly actions: ActionFunction<Readonly<{
|
|
368
|
-
subject: Subject;
|
|
369
|
-
viewId: ViewId;
|
|
370
|
-
xyflow: XYFLowInstance | null;
|
|
371
|
-
xystore: XYStoreApi | null;
|
|
372
|
-
initialized: {
|
|
373
|
-
xydata: boolean;
|
|
374
|
-
xyflow: boolean;
|
|
375
|
-
};
|
|
376
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
377
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
378
|
-
bounds: BBox;
|
|
379
|
-
}>, {
|
|
380
|
-
type: "dim.nonhovered.edges";
|
|
381
|
-
}, Events, undefined, never, never, never, never, never>;
|
|
382
|
-
};
|
|
383
|
-
readonly 'undim.edges': {
|
|
384
|
-
readonly actions: ActionFunction<Readonly<{
|
|
385
|
-
subject: Subject;
|
|
386
|
-
viewId: ViewId;
|
|
387
|
-
xyflow: XYFLowInstance | null;
|
|
388
|
-
xystore: XYStoreApi | null;
|
|
389
|
-
initialized: {
|
|
390
|
-
xydata: boolean;
|
|
391
|
-
xyflow: boolean;
|
|
392
|
-
};
|
|
393
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
394
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
395
|
-
bounds: BBox;
|
|
396
|
-
}>, {
|
|
397
|
-
type: "undim.edges";
|
|
398
|
-
}, Events, undefined, never, never, never, never, never>;
|
|
399
|
-
};
|
|
400
|
-
readonly 'xyflow.selectionChange': {
|
|
401
|
-
readonly actions: ActionFunction<Readonly<{
|
|
402
|
-
subject: Subject;
|
|
403
|
-
viewId: ViewId;
|
|
404
|
-
xyflow: XYFLowInstance | null;
|
|
405
|
-
xystore: XYStoreApi | null;
|
|
406
|
-
initialized: {
|
|
407
|
-
xydata: boolean;
|
|
408
|
-
xyflow: boolean;
|
|
409
|
-
};
|
|
410
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
411
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
412
|
-
bounds: BBox;
|
|
413
|
-
}>, {
|
|
414
|
-
type: "xyflow.selectionChange";
|
|
415
|
-
nodes: RelationshipDetailsTypes.Node[];
|
|
416
|
-
edges: RelationshipDetailsTypes.Edge[];
|
|
417
|
-
}, Events, undefined, never, Values<{
|
|
418
|
-
"xyflow:fitDiagram": {
|
|
419
|
-
type: "xyflow:fitDiagram";
|
|
420
|
-
params: {
|
|
421
|
-
duration?: number;
|
|
422
|
-
bounds?: BBox;
|
|
423
|
-
} | undefined;
|
|
424
|
-
};
|
|
425
|
-
"xyflow:updateNodeInternals": {
|
|
426
|
-
type: "xyflow:updateNodeInternals";
|
|
427
|
-
params: unknown;
|
|
428
|
-
};
|
|
429
|
-
updateXYFlow: {
|
|
430
|
-
type: "updateXYFlow";
|
|
431
|
-
params: NonReducibleUnknown;
|
|
432
|
-
};
|
|
433
|
-
updateLayoutData: {
|
|
434
|
-
type: "updateLayoutData";
|
|
435
|
-
params: NonReducibleUnknown;
|
|
436
|
-
};
|
|
437
|
-
"open relationship source": {
|
|
438
|
-
type: "open relationship source";
|
|
439
|
-
params: NonReducibleUnknown;
|
|
440
|
-
};
|
|
441
|
-
}>, Values<{
|
|
442
|
-
isReady: {
|
|
443
|
-
type: "isReady";
|
|
444
|
-
params: unknown;
|
|
445
|
-
};
|
|
446
|
-
"enable: navigate.to": {
|
|
447
|
-
type: "enable: navigate.to";
|
|
448
|
-
params: unknown;
|
|
449
|
-
};
|
|
450
|
-
}>, never, EventObject>;
|
|
451
|
-
};
|
|
452
|
-
readonly 'update.layoutData': {
|
|
453
|
-
readonly actions: readonly ["updateLayoutData", CancelAction<Readonly<{
|
|
454
|
-
subject: Subject;
|
|
455
|
-
viewId: ViewId;
|
|
456
|
-
xyflow: XYFLowInstance | null;
|
|
457
|
-
xystore: XYStoreApi | null;
|
|
458
|
-
initialized: {
|
|
459
|
-
xydata: boolean;
|
|
460
|
-
xyflow: boolean;
|
|
461
|
-
};
|
|
462
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
463
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
464
|
-
bounds: BBox;
|
|
465
|
-
}>, {
|
|
466
|
-
type: "update.layoutData";
|
|
467
|
-
data: LayoutResult;
|
|
468
|
-
}, undefined, Events>, ActionFunction<Readonly<{
|
|
469
|
-
subject: Subject;
|
|
470
|
-
viewId: ViewId;
|
|
471
|
-
xyflow: XYFLowInstance | null;
|
|
472
|
-
xystore: XYStoreApi | null;
|
|
473
|
-
initialized: {
|
|
474
|
-
xydata: boolean;
|
|
475
|
-
xyflow: boolean;
|
|
476
|
-
};
|
|
477
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
478
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
479
|
-
bounds: BBox;
|
|
480
|
-
}>, {
|
|
481
|
-
type: "update.layoutData";
|
|
482
|
-
data: LayoutResult;
|
|
483
|
-
}, Events, undefined, never, never, never, never, never>, ActionFunction<Readonly<{
|
|
484
|
-
subject: Subject;
|
|
485
|
-
viewId: ViewId;
|
|
486
|
-
xyflow: XYFLowInstance | null;
|
|
487
|
-
xystore: XYStoreApi | null;
|
|
488
|
-
initialized: {
|
|
489
|
-
xydata: boolean;
|
|
490
|
-
xyflow: boolean;
|
|
491
|
-
};
|
|
492
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
493
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
494
|
-
bounds: BBox;
|
|
495
|
-
}>, {
|
|
496
|
-
type: "update.layoutData";
|
|
497
|
-
data: LayoutResult;
|
|
498
|
-
}, Events, undefined, never, never, never, never, never>];
|
|
499
|
-
};
|
|
500
|
-
readonly 'xyflow.init': {
|
|
501
|
-
readonly actions: "updateXYFlow";
|
|
502
|
-
};
|
|
503
|
-
readonly 'xyflow.applyNodeChanges': {
|
|
504
|
-
readonly actions: ActionFunction<Readonly<{
|
|
505
|
-
subject: Subject;
|
|
506
|
-
viewId: ViewId;
|
|
507
|
-
xyflow: XYFLowInstance | null;
|
|
508
|
-
xystore: XYStoreApi | null;
|
|
509
|
-
initialized: {
|
|
510
|
-
xydata: boolean;
|
|
511
|
-
xyflow: boolean;
|
|
512
|
-
};
|
|
513
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
514
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
515
|
-
bounds: BBox;
|
|
516
|
-
}>, {
|
|
517
|
-
type: "xyflow.applyNodeChanges";
|
|
518
|
-
changes: NodeChange<RelationshipDetailsTypes.Node>[];
|
|
519
|
-
}, Events, undefined, never, never, never, never, never>;
|
|
520
|
-
};
|
|
521
|
-
readonly 'xyflow.applyEdgeChanges': {
|
|
522
|
-
readonly actions: ActionFunction<Readonly<{
|
|
523
|
-
subject: Subject;
|
|
524
|
-
viewId: ViewId;
|
|
525
|
-
xyflow: XYFLowInstance | null;
|
|
526
|
-
xystore: XYStoreApi | null;
|
|
527
|
-
initialized: {
|
|
528
|
-
xydata: boolean;
|
|
529
|
-
xyflow: boolean;
|
|
530
|
-
};
|
|
531
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
532
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
533
|
-
bounds: BBox;
|
|
534
|
-
}>, {
|
|
535
|
-
type: "xyflow.applyEdgeChanges";
|
|
536
|
-
changes: EdgeChange<RelationshipDetailsTypes.Edge>[];
|
|
537
|
-
}, Events, undefined, never, never, never, never, never>;
|
|
538
|
-
};
|
|
539
|
-
readonly 'xyflow.paneDblClick': {
|
|
540
|
-
readonly actions: "xyflow:fitDiagram";
|
|
541
|
-
};
|
|
542
|
-
readonly 'xyflow.edgeClick': {
|
|
543
|
-
readonly actions: "open relationship source";
|
|
544
|
-
};
|
|
545
|
-
readonly 'navigate.to': {
|
|
546
|
-
readonly actions: ActionFunction<Readonly<{
|
|
547
|
-
subject: Subject;
|
|
548
|
-
viewId: ViewId;
|
|
549
|
-
xyflow: XYFLowInstance | null;
|
|
550
|
-
xystore: XYStoreApi | null;
|
|
551
|
-
initialized: {
|
|
552
|
-
xydata: boolean;
|
|
553
|
-
xyflow: boolean;
|
|
554
|
-
};
|
|
555
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
556
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
557
|
-
bounds: BBox;
|
|
558
|
-
}>, {
|
|
559
|
-
type: "navigate.to";
|
|
560
|
-
params: {
|
|
561
|
-
edgeId: EdgeId;
|
|
562
|
-
viewId?: ViewId;
|
|
563
|
-
} | {
|
|
564
|
-
source: Fqn;
|
|
565
|
-
target: Fqn;
|
|
566
|
-
viewId?: ViewId;
|
|
567
|
-
};
|
|
568
|
-
}, Events, undefined, never, never, never, never, never>;
|
|
569
|
-
};
|
|
570
|
-
readonly close: {
|
|
571
|
-
readonly target: "closed";
|
|
572
|
-
};
|
|
573
|
-
};
|
|
574
|
-
readonly exit: ActionFunction<Readonly<{
|
|
575
|
-
subject: Subject;
|
|
576
|
-
viewId: ViewId;
|
|
577
|
-
xyflow: XYFLowInstance | null;
|
|
578
|
-
xystore: XYStoreApi | null;
|
|
579
|
-
initialized: {
|
|
580
|
-
xydata: boolean;
|
|
581
|
-
xyflow: boolean;
|
|
582
|
-
};
|
|
583
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
584
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
585
|
-
bounds: BBox;
|
|
586
|
-
}>, Events, Events, undefined, never, never, never, never, never>;
|
|
587
|
-
};
|
|
588
|
-
readonly closed: {
|
|
589
|
-
readonly type: "final";
|
|
590
|
-
};
|
|
591
|
-
};
|
|
592
|
-
readonly on: {
|
|
593
|
-
readonly fitDiagram: {
|
|
594
|
-
readonly actions: {
|
|
595
|
-
readonly type: "xyflow:fitDiagram";
|
|
596
|
-
readonly params: (data: {
|
|
597
|
-
context: Readonly<{
|
|
598
|
-
subject: Subject;
|
|
599
|
-
viewId: ViewId;
|
|
600
|
-
xyflow: XYFLowInstance | null;
|
|
601
|
-
xystore: XYStoreApi | null;
|
|
602
|
-
initialized: {
|
|
603
|
-
xydata: boolean;
|
|
604
|
-
xyflow: boolean;
|
|
605
|
-
};
|
|
606
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
607
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
608
|
-
bounds: BBox;
|
|
609
|
-
}>;
|
|
610
|
-
event: {
|
|
611
|
-
type: "fitDiagram";
|
|
612
|
-
duration?: number;
|
|
613
|
-
bounds?: BBox;
|
|
614
|
-
};
|
|
615
|
-
}) => {
|
|
616
|
-
type: "fitDiagram";
|
|
617
|
-
duration?: number;
|
|
618
|
-
bounds?: BBox;
|
|
619
|
-
};
|
|
620
|
-
};
|
|
621
|
-
};
|
|
622
|
-
readonly 'xyflow.resized': {
|
|
623
|
-
readonly actions: readonly [ CancelAction<Readonly<{
|
|
624
|
-
subject: Subject;
|
|
625
|
-
viewId: ViewId;
|
|
626
|
-
xyflow: XYFLowInstance | null;
|
|
627
|
-
xystore: XYStoreApi | null;
|
|
628
|
-
initialized: {
|
|
629
|
-
xydata: boolean;
|
|
630
|
-
xyflow: boolean;
|
|
631
|
-
};
|
|
632
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
633
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
634
|
-
bounds: BBox;
|
|
635
|
-
}>, {
|
|
636
|
-
type: "xyflow.resized";
|
|
637
|
-
}, undefined, Events>, ActionFunction<Readonly<{
|
|
638
|
-
subject: Subject;
|
|
639
|
-
viewId: ViewId;
|
|
640
|
-
xyflow: XYFLowInstance | null;
|
|
641
|
-
xystore: XYStoreApi | null;
|
|
642
|
-
initialized: {
|
|
643
|
-
xydata: boolean;
|
|
644
|
-
xyflow: boolean;
|
|
645
|
-
};
|
|
646
|
-
xynodes: RelationshipDetailsTypes.Node[];
|
|
647
|
-
xyedges: RelationshipDetailsTypes.Edge[];
|
|
648
|
-
bounds: BBox;
|
|
649
|
-
}>, {
|
|
650
|
-
type: "xyflow.resized";
|
|
651
|
-
}, Events, undefined, never, never, never, never, never>];
|
|
652
|
-
};
|
|
653
|
-
readonly 'xyflow.updateNodeInternals': {
|
|
654
|
-
readonly actions: "xyflow:updateNodeInternals";
|
|
655
|
-
};
|
|
656
|
-
};
|
|
657
|
-
}>;
|
|
658
|
-
type InferredMachine = typeof _relationshipDetailsLogic;
|
|
659
|
-
export interface RelationshipDetailsLogic extends InferredMachine {
|
|
102
|
+
export type Tags = never;
|
|
103
|
+
export interface RelationshipDetailsLogic extends StateMachine<Context, Events, {}, any, any, any, any, any, Tags, Input, any, any, any, any> {
|
|
660
104
|
}
|
|
661
105
|
export declare const relationshipDetailsLogic: RelationshipDetailsLogic;
|
|
662
|
-
export interface RelationshipDetailsActorRef extends ActorRefFromLogic<RelationshipDetailsLogic> {
|
|
663
|
-
}
|
|
664
106
|
export type RelationshipDetailsSnapshot = SnapshotFrom<RelationshipDetailsLogic>;
|
|
665
|
-
export {
|
|
107
|
+
export interface RelationshipDetailsActorRef extends ActorRef<RelationshipDetailsSnapshot, Events> {
|
|
108
|
+
}
|
|
109
|
+
export type { Input as RelationshipDetailsInput, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Queue, nonNullable
|
|
1
|
+
import { Queue, nonNullable } from '@likec4/core';
|
|
2
2
|
import { hasAtLeast } from 'remeda';
|
|
3
3
|
import { ZIndexes } from '../../base/const.js';
|
|
4
4
|
|
|
@@ -36,8 +36,6 @@ function layoutResultToXYFlow(layout) {
|
|
|
36
36
|
const base = {
|
|
37
37
|
id,
|
|
38
38
|
draggable: false,
|
|
39
|
-
selectable: true,
|
|
40
|
-
focusable: true,
|
|
41
39
|
deletable: false,
|
|
42
40
|
position,
|
|
43
41
|
zIndex: isCompound ? ZIndexes.Compound : ZIndexes.Element,
|
|
@@ -86,7 +84,7 @@ function layoutResultToXYFlow(layout) {
|
|
|
86
84
|
fqn,
|
|
87
85
|
title: node.title,
|
|
88
86
|
technology: node.technology,
|
|
89
|
-
description:
|
|
87
|
+
description: node.description ?? null,
|
|
90
88
|
height: node.height,
|
|
91
89
|
width: node.width,
|
|
92
90
|
color: node.color,
|
|
@@ -131,7 +129,7 @@ function layoutResultToXYFlow(layout) {
|
|
|
131
129
|
color,
|
|
132
130
|
navigateTo,
|
|
133
131
|
line,
|
|
134
|
-
description:
|
|
132
|
+
description: description ?? null,
|
|
135
133
|
...technology && { technology }
|
|
136
134
|
}
|
|
137
135
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyAux, DiagramEdge, DiagramNode, DiagramView, Fqn,
|
|
1
|
+
import { AnyAux, DiagramEdge, DiagramNode, DiagramView, Fqn, MarkdownOrString, RelationId } from '@likec4/core/types';
|
|
2
2
|
import { LikeC4ViewModel } from '@likec4/core/model';
|
|
3
3
|
import { Except } from 'type-fest';
|
|
4
4
|
import { RelationshipDetailsTypes } from './_types';
|
|
@@ -10,7 +10,7 @@ export type LayoutResult = {
|
|
|
10
10
|
};
|
|
11
11
|
export declare namespace LayoutResult {
|
|
12
12
|
type Node = Except<DiagramNode, 'modelRef' | 'description' | 'deploymentRef' | 'inEdges' | 'outEdges'> & {
|
|
13
|
-
description:
|
|
13
|
+
description: MarkdownOrString | null;
|
|
14
14
|
modelRef: Fqn;
|
|
15
15
|
column: RelationshipDetailsTypes.Column;
|
|
16
16
|
ports: RelationshipDetailsTypes.Ports;
|
|
@@ -19,7 +19,7 @@ export declare namespace LayoutResult {
|
|
|
19
19
|
relationId: RelationId;
|
|
20
20
|
sourceHandle: string;
|
|
21
21
|
targetHandle: string;
|
|
22
|
-
description:
|
|
22
|
+
description: MarkdownOrString | null;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
export declare function layoutRelationshipDetails(data: RelationshipDetailsViewData, scope: LikeC4ViewModel<AnyAux> | null): LayoutResult;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { treeFromElements } from '@likec4/core/compute-view/relationships';
|
|
2
|
-
import { exact } from '@likec4/core/types';
|
|
2
|
+
import { exact, preferSummary } from '@likec4/core/types';
|
|
3
3
|
import dagre from '@dagrejs/dagre';
|
|
4
4
|
import { ifind, DefaultMap, invariant } from '@likec4/core/utils';
|
|
5
5
|
import { pipe, filter, mapToObj, omit, find, map, tap, reduce, sortBy, prop } from 'remeda';
|
|
@@ -239,7 +239,7 @@ function layoutRelationshipDetails(data, scope) {
|
|
|
239
239
|
x: position.x,
|
|
240
240
|
y: position.y,
|
|
241
241
|
title: element.title,
|
|
242
|
-
description: element
|
|
242
|
+
description: preferSummary(element.$element) ?? null,
|
|
243
243
|
technology: element.technology,
|
|
244
244
|
tags: [...element.tags],
|
|
245
245
|
links: null,
|
|
@@ -288,7 +288,7 @@ function layoutRelationshipDetails(data, scope) {
|
|
|
288
288
|
const { name, source, target, relationship, sourceHandle, targetHandle } = find(edges, (e2) => e2.name === ename);
|
|
289
289
|
const label = relationship.title ?? "untitled";
|
|
290
290
|
const navigateTo = relationship.navigateTo?.id ?? null;
|
|
291
|
-
const description = relationship
|
|
291
|
+
const description = preferSummary(relationship.$relationship) ?? null;
|
|
292
292
|
const technology = relationship.technology ?? null;
|
|
293
293
|
acc.push({
|
|
294
294
|
id: name,
|
|
@@ -298,8 +298,8 @@ function layoutRelationshipDetails(data, scope) {
|
|
|
298
298
|
targetHandle,
|
|
299
299
|
label,
|
|
300
300
|
color: relationship.color,
|
|
301
|
+
description,
|
|
301
302
|
...navigateTo && { navigateTo },
|
|
302
|
-
...description && { description },
|
|
303
303
|
...technology && { technology },
|
|
304
304
|
points: edge.points.map((p) => [p.x, p.y]),
|
|
305
305
|
line: relationship.line,
|