@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,7 +1,6 @@
|
|
|
1
1
|
import { Fqn } from '@likec4/core/types';
|
|
2
|
-
import {
|
|
2
|
+
import { ActorRef, SnapshotFrom, StateMachine } from 'xstate';
|
|
3
3
|
import { Overlays } from './types';
|
|
4
|
-
import { ElementDetailsLogic } from './element-details/actor';
|
|
5
4
|
export type OverlayActorEvent = {
|
|
6
5
|
type: 'open.elementDetails';
|
|
7
6
|
} & Overlays.ElementDetails.Input | {
|
|
@@ -38,397 +37,13 @@ export type OverlayActorEmitedEvent = {
|
|
|
38
37
|
} | {
|
|
39
38
|
type: 'idle';
|
|
40
39
|
};
|
|
41
|
-
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
|
|
46
|
-
}, Values<{
|
|
47
|
-
elementDetails: {
|
|
48
|
-
src: "elementDetails";
|
|
49
|
-
logic: ElementDetailsLogic;
|
|
50
|
-
id: `elementDetails-${number}`;
|
|
51
|
-
};
|
|
52
|
-
relationshipsBrowser: {
|
|
53
|
-
src: "relationshipsBrowser";
|
|
54
|
-
logic: Overlays.RelationshipsBrowser.Logic;
|
|
55
|
-
id: `relationshipsBrowser-${number}`;
|
|
56
|
-
};
|
|
57
|
-
relationshipDetails: {
|
|
58
|
-
src: "relationshipDetails";
|
|
59
|
-
logic: Overlays.RelationshipDetails.Logic;
|
|
60
|
-
id: `relationshipDetails-${number}`;
|
|
61
|
-
};
|
|
62
|
-
hotkey: {
|
|
63
|
-
src: "hotkey";
|
|
64
|
-
logic: CallbackActorLogic<EventObject, NonReducibleUnknown, EventObject>;
|
|
65
|
-
id: "hotkey";
|
|
66
|
-
};
|
|
67
|
-
}>, never, Values<{
|
|
68
|
-
"has overlays?": {
|
|
69
|
-
type: "has overlays?";
|
|
70
|
-
params: unknown;
|
|
71
|
-
};
|
|
72
|
-
"close specific overlay?": {
|
|
73
|
-
type: "close specific overlay?";
|
|
74
|
-
params: unknown;
|
|
75
|
-
};
|
|
76
|
-
"last: is relationshipDetails?": {
|
|
77
|
-
type: "last: is relationshipDetails?";
|
|
78
|
-
params: unknown;
|
|
79
|
-
};
|
|
80
|
-
"last: is relationshipsBrowser?": {
|
|
81
|
-
type: "last: is relationshipsBrowser?";
|
|
82
|
-
params: unknown;
|
|
83
|
-
};
|
|
84
|
-
}>, never, "active" | "idle" | "closing", string, NonReducibleUnknown, NonReducibleUnknown, OverlayActorEmitedEvent, MetaObject, {
|
|
85
|
-
readonly id: "overlays";
|
|
86
|
-
readonly context: () => {
|
|
87
|
-
seq: number;
|
|
88
|
-
overlays: never[];
|
|
89
|
-
};
|
|
90
|
-
readonly initial: "idle";
|
|
91
|
-
readonly on: {
|
|
92
|
-
readonly 'open.elementDetails': {
|
|
93
|
-
readonly actions: ActionFunction<OverlaysContext, OverlayActorEvent, OverlayActorEvent, undefined, Values<{
|
|
94
|
-
elementDetails: {
|
|
95
|
-
src: "elementDetails";
|
|
96
|
-
logic: ElementDetailsLogic;
|
|
97
|
-
id: `elementDetails-${number}`;
|
|
98
|
-
};
|
|
99
|
-
relationshipsBrowser: {
|
|
100
|
-
src: "relationshipsBrowser";
|
|
101
|
-
logic: Overlays.RelationshipsBrowser.Logic;
|
|
102
|
-
id: `relationshipsBrowser-${number}`;
|
|
103
|
-
};
|
|
104
|
-
relationshipDetails: {
|
|
105
|
-
src: "relationshipDetails";
|
|
106
|
-
logic: Overlays.RelationshipDetails.Logic;
|
|
107
|
-
id: `relationshipDetails-${number}`;
|
|
108
|
-
};
|
|
109
|
-
hotkey: {
|
|
110
|
-
src: "hotkey";
|
|
111
|
-
logic: CallbackActorLogic<EventObject, NonReducibleUnknown, EventObject>;
|
|
112
|
-
id: "hotkey";
|
|
113
|
-
};
|
|
114
|
-
}>, never, Values<{
|
|
115
|
-
"has overlays?": {
|
|
116
|
-
type: "has overlays?";
|
|
117
|
-
params: unknown;
|
|
118
|
-
};
|
|
119
|
-
"close specific overlay?": {
|
|
120
|
-
type: "close specific overlay?";
|
|
121
|
-
params: unknown;
|
|
122
|
-
};
|
|
123
|
-
"last: is relationshipDetails?": {
|
|
124
|
-
type: "last: is relationshipDetails?";
|
|
125
|
-
params: unknown;
|
|
126
|
-
};
|
|
127
|
-
"last: is relationshipsBrowser?": {
|
|
128
|
-
type: "last: is relationshipsBrowser?";
|
|
129
|
-
params: unknown;
|
|
130
|
-
};
|
|
131
|
-
}>, never, OverlayActorEmitedEvent>;
|
|
132
|
-
readonly target: ".active";
|
|
133
|
-
readonly reenter: false;
|
|
134
|
-
};
|
|
135
|
-
readonly 'open.relationshipDetails': {
|
|
136
|
-
readonly actions: ActionFunction<OverlaysContext, OverlayActorEvent, OverlayActorEvent, undefined, Values<{
|
|
137
|
-
elementDetails: {
|
|
138
|
-
src: "elementDetails";
|
|
139
|
-
logic: ElementDetailsLogic;
|
|
140
|
-
id: `elementDetails-${number}`;
|
|
141
|
-
};
|
|
142
|
-
relationshipsBrowser: {
|
|
143
|
-
src: "relationshipsBrowser";
|
|
144
|
-
logic: Overlays.RelationshipsBrowser.Logic;
|
|
145
|
-
id: `relationshipsBrowser-${number}`;
|
|
146
|
-
};
|
|
147
|
-
relationshipDetails: {
|
|
148
|
-
src: "relationshipDetails";
|
|
149
|
-
logic: Overlays.RelationshipDetails.Logic;
|
|
150
|
-
id: `relationshipDetails-${number}`;
|
|
151
|
-
};
|
|
152
|
-
hotkey: {
|
|
153
|
-
src: "hotkey";
|
|
154
|
-
logic: CallbackActorLogic<EventObject, NonReducibleUnknown, EventObject>;
|
|
155
|
-
id: "hotkey";
|
|
156
|
-
};
|
|
157
|
-
}>, never, Values<{
|
|
158
|
-
"has overlays?": {
|
|
159
|
-
type: "has overlays?";
|
|
160
|
-
params: unknown;
|
|
161
|
-
};
|
|
162
|
-
"close specific overlay?": {
|
|
163
|
-
type: "close specific overlay?";
|
|
164
|
-
params: unknown;
|
|
165
|
-
};
|
|
166
|
-
"last: is relationshipDetails?": {
|
|
167
|
-
type: "last: is relationshipDetails?";
|
|
168
|
-
params: unknown;
|
|
169
|
-
};
|
|
170
|
-
"last: is relationshipsBrowser?": {
|
|
171
|
-
type: "last: is relationshipsBrowser?";
|
|
172
|
-
params: unknown;
|
|
173
|
-
};
|
|
174
|
-
}>, never, OverlayActorEmitedEvent>;
|
|
175
|
-
readonly target: ".active";
|
|
176
|
-
readonly reenter: false;
|
|
177
|
-
};
|
|
178
|
-
readonly 'open.relationshipsBrowser': {
|
|
179
|
-
readonly actions: ActionFunction<OverlaysContext, OverlayActorEvent, OverlayActorEvent, undefined, Values<{
|
|
180
|
-
elementDetails: {
|
|
181
|
-
src: "elementDetails";
|
|
182
|
-
logic: ElementDetailsLogic;
|
|
183
|
-
id: `elementDetails-${number}`;
|
|
184
|
-
};
|
|
185
|
-
relationshipsBrowser: {
|
|
186
|
-
src: "relationshipsBrowser";
|
|
187
|
-
logic: Overlays.RelationshipsBrowser.Logic;
|
|
188
|
-
id: `relationshipsBrowser-${number}`;
|
|
189
|
-
};
|
|
190
|
-
relationshipDetails: {
|
|
191
|
-
src: "relationshipDetails";
|
|
192
|
-
logic: Overlays.RelationshipDetails.Logic;
|
|
193
|
-
id: `relationshipDetails-${number}`;
|
|
194
|
-
};
|
|
195
|
-
hotkey: {
|
|
196
|
-
src: "hotkey";
|
|
197
|
-
logic: CallbackActorLogic<EventObject, NonReducibleUnknown, EventObject>;
|
|
198
|
-
id: "hotkey";
|
|
199
|
-
};
|
|
200
|
-
}>, never, Values<{
|
|
201
|
-
"has overlays?": {
|
|
202
|
-
type: "has overlays?";
|
|
203
|
-
params: unknown;
|
|
204
|
-
};
|
|
205
|
-
"close specific overlay?": {
|
|
206
|
-
type: "close specific overlay?";
|
|
207
|
-
params: unknown;
|
|
208
|
-
};
|
|
209
|
-
"last: is relationshipDetails?": {
|
|
210
|
-
type: "last: is relationshipDetails?";
|
|
211
|
-
params: unknown;
|
|
212
|
-
};
|
|
213
|
-
"last: is relationshipsBrowser?": {
|
|
214
|
-
type: "last: is relationshipsBrowser?";
|
|
215
|
-
params: unknown;
|
|
216
|
-
};
|
|
217
|
-
}>, never, OverlayActorEmitedEvent>;
|
|
218
|
-
readonly target: ".active";
|
|
219
|
-
readonly reenter: false;
|
|
220
|
-
};
|
|
221
|
-
};
|
|
222
|
-
readonly states: {
|
|
223
|
-
readonly idle: {};
|
|
224
|
-
readonly active: {
|
|
225
|
-
readonly entry: ActionFunction<OverlaysContext, OverlayActorEvent, OverlayActorEvent, undefined, Values<{
|
|
226
|
-
elementDetails: {
|
|
227
|
-
src: "elementDetails";
|
|
228
|
-
logic: ElementDetailsLogic;
|
|
229
|
-
id: `elementDetails-${number}`;
|
|
230
|
-
};
|
|
231
|
-
relationshipsBrowser: {
|
|
232
|
-
src: "relationshipsBrowser";
|
|
233
|
-
logic: Overlays.RelationshipsBrowser.Logic;
|
|
234
|
-
id: `relationshipsBrowser-${number}`;
|
|
235
|
-
};
|
|
236
|
-
relationshipDetails: {
|
|
237
|
-
src: "relationshipDetails";
|
|
238
|
-
logic: Overlays.RelationshipDetails.Logic;
|
|
239
|
-
id: `relationshipDetails-${number}`;
|
|
240
|
-
};
|
|
241
|
-
hotkey: {
|
|
242
|
-
src: "hotkey";
|
|
243
|
-
logic: CallbackActorLogic<EventObject, NonReducibleUnknown, EventObject>;
|
|
244
|
-
id: "hotkey";
|
|
245
|
-
};
|
|
246
|
-
}>, never, never, never, never>;
|
|
247
|
-
readonly exit: StopAction<OverlaysContext, OverlayActorEvent, undefined, OverlayActorEvent>;
|
|
248
|
-
readonly on: {
|
|
249
|
-
readonly close: readonly [{
|
|
250
|
-
readonly guard: "close specific overlay?";
|
|
251
|
-
readonly actions: ActionFunction<OverlaysContext, OverlayActorEvent, OverlayActorEvent, undefined, Values<{
|
|
252
|
-
elementDetails: {
|
|
253
|
-
src: "elementDetails";
|
|
254
|
-
logic: ElementDetailsLogic;
|
|
255
|
-
id: `elementDetails-${number}`;
|
|
256
|
-
};
|
|
257
|
-
relationshipsBrowser: {
|
|
258
|
-
src: "relationshipsBrowser";
|
|
259
|
-
logic: Overlays.RelationshipsBrowser.Logic;
|
|
260
|
-
id: `relationshipsBrowser-${number}`;
|
|
261
|
-
};
|
|
262
|
-
relationshipDetails: {
|
|
263
|
-
src: "relationshipDetails";
|
|
264
|
-
logic: Overlays.RelationshipDetails.Logic;
|
|
265
|
-
id: `relationshipDetails-${number}`;
|
|
266
|
-
};
|
|
267
|
-
hotkey: {
|
|
268
|
-
src: "hotkey";
|
|
269
|
-
logic: CallbackActorLogic<EventObject, NonReducibleUnknown, EventObject>;
|
|
270
|
-
id: "hotkey";
|
|
271
|
-
};
|
|
272
|
-
}>, never, Values<{
|
|
273
|
-
"has overlays?": {
|
|
274
|
-
type: "has overlays?";
|
|
275
|
-
params: unknown;
|
|
276
|
-
};
|
|
277
|
-
"close specific overlay?": {
|
|
278
|
-
type: "close specific overlay?";
|
|
279
|
-
params: unknown;
|
|
280
|
-
};
|
|
281
|
-
"last: is relationshipDetails?": {
|
|
282
|
-
type: "last: is relationshipDetails?";
|
|
283
|
-
params: unknown;
|
|
284
|
-
};
|
|
285
|
-
"last: is relationshipsBrowser?": {
|
|
286
|
-
type: "last: is relationshipsBrowser?";
|
|
287
|
-
params: unknown;
|
|
288
|
-
};
|
|
289
|
-
}>, never, OverlayActorEmitedEvent>;
|
|
290
|
-
readonly target: "closing";
|
|
291
|
-
}, {
|
|
292
|
-
readonly actions: ActionFunction<OverlaysContext, OverlayActorEvent, OverlayActorEvent, undefined, Values<{
|
|
293
|
-
elementDetails: {
|
|
294
|
-
src: "elementDetails";
|
|
295
|
-
logic: ElementDetailsLogic;
|
|
296
|
-
id: `elementDetails-${number}`;
|
|
297
|
-
};
|
|
298
|
-
relationshipsBrowser: {
|
|
299
|
-
src: "relationshipsBrowser";
|
|
300
|
-
logic: Overlays.RelationshipsBrowser.Logic;
|
|
301
|
-
id: `relationshipsBrowser-${number}`;
|
|
302
|
-
};
|
|
303
|
-
relationshipDetails: {
|
|
304
|
-
src: "relationshipDetails";
|
|
305
|
-
logic: Overlays.RelationshipDetails.Logic;
|
|
306
|
-
id: `relationshipDetails-${number}`;
|
|
307
|
-
};
|
|
308
|
-
hotkey: {
|
|
309
|
-
src: "hotkey";
|
|
310
|
-
logic: CallbackActorLogic<EventObject, NonReducibleUnknown, EventObject>;
|
|
311
|
-
id: "hotkey";
|
|
312
|
-
};
|
|
313
|
-
}>, never, Values<{
|
|
314
|
-
"has overlays?": {
|
|
315
|
-
type: "has overlays?";
|
|
316
|
-
params: unknown;
|
|
317
|
-
};
|
|
318
|
-
"close specific overlay?": {
|
|
319
|
-
type: "close specific overlay?";
|
|
320
|
-
params: unknown;
|
|
321
|
-
};
|
|
322
|
-
"last: is relationshipDetails?": {
|
|
323
|
-
type: "last: is relationshipDetails?";
|
|
324
|
-
params: unknown;
|
|
325
|
-
};
|
|
326
|
-
"last: is relationshipsBrowser?": {
|
|
327
|
-
type: "last: is relationshipsBrowser?";
|
|
328
|
-
params: unknown;
|
|
329
|
-
};
|
|
330
|
-
}>, never, OverlayActorEmitedEvent>;
|
|
331
|
-
readonly target: "closing";
|
|
332
|
-
}];
|
|
333
|
-
readonly 'close.all': {
|
|
334
|
-
readonly actions: readonly [ ActionFunction<OverlaysContext, OverlayActorEvent, OverlayActorEvent, undefined, Values<{
|
|
335
|
-
elementDetails: {
|
|
336
|
-
src: "elementDetails";
|
|
337
|
-
logic: ElementDetailsLogic;
|
|
338
|
-
id: `elementDetails-${number}`;
|
|
339
|
-
};
|
|
340
|
-
relationshipsBrowser: {
|
|
341
|
-
src: "relationshipsBrowser";
|
|
342
|
-
logic: Overlays.RelationshipsBrowser.Logic;
|
|
343
|
-
id: `relationshipsBrowser-${number}`;
|
|
344
|
-
};
|
|
345
|
-
relationshipDetails: {
|
|
346
|
-
src: "relationshipDetails";
|
|
347
|
-
logic: Overlays.RelationshipDetails.Logic;
|
|
348
|
-
id: `relationshipDetails-${number}`;
|
|
349
|
-
};
|
|
350
|
-
hotkey: {
|
|
351
|
-
src: "hotkey";
|
|
352
|
-
logic: CallbackActorLogic<EventObject, NonReducibleUnknown, EventObject>;
|
|
353
|
-
id: "hotkey";
|
|
354
|
-
};
|
|
355
|
-
}>, never, Values<{
|
|
356
|
-
"has overlays?": {
|
|
357
|
-
type: "has overlays?";
|
|
358
|
-
params: unknown;
|
|
359
|
-
};
|
|
360
|
-
"close specific overlay?": {
|
|
361
|
-
type: "close specific overlay?";
|
|
362
|
-
params: unknown;
|
|
363
|
-
};
|
|
364
|
-
"last: is relationshipDetails?": {
|
|
365
|
-
type: "last: is relationshipDetails?";
|
|
366
|
-
params: unknown;
|
|
367
|
-
};
|
|
368
|
-
"last: is relationshipsBrowser?": {
|
|
369
|
-
type: "last: is relationshipsBrowser?";
|
|
370
|
-
params: unknown;
|
|
371
|
-
};
|
|
372
|
-
}>, never, OverlayActorEmitedEvent>, StopAction<OverlaysContext, OverlayActorEvent, undefined, OverlayActorEvent>];
|
|
373
|
-
readonly target: "idle";
|
|
374
|
-
};
|
|
375
|
-
};
|
|
376
|
-
};
|
|
377
|
-
readonly closing: {
|
|
378
|
-
readonly always: readonly [{
|
|
379
|
-
readonly guard: "has overlays?";
|
|
380
|
-
readonly target: "active";
|
|
381
|
-
}, {
|
|
382
|
-
readonly actions: StopAction<OverlaysContext, OverlayActorEvent, undefined, OverlayActorEvent>;
|
|
383
|
-
readonly target: "idle";
|
|
384
|
-
}];
|
|
385
|
-
};
|
|
386
|
-
};
|
|
387
|
-
readonly exit: readonly [ StopAction<OverlaysContext, OverlayActorEvent, undefined, OverlayActorEvent>, ActionFunction<OverlaysContext, OverlayActorEvent, OverlayActorEvent, undefined, Values<{
|
|
388
|
-
elementDetails: {
|
|
389
|
-
src: "elementDetails";
|
|
390
|
-
logic: ElementDetailsLogic;
|
|
391
|
-
id: `elementDetails-${number}`;
|
|
392
|
-
};
|
|
393
|
-
relationshipsBrowser: {
|
|
394
|
-
src: "relationshipsBrowser";
|
|
395
|
-
logic: Overlays.RelationshipsBrowser.Logic;
|
|
396
|
-
id: `relationshipsBrowser-${number}`;
|
|
397
|
-
};
|
|
398
|
-
relationshipDetails: {
|
|
399
|
-
src: "relationshipDetails";
|
|
400
|
-
logic: Overlays.RelationshipDetails.Logic;
|
|
401
|
-
id: `relationshipDetails-${number}`;
|
|
402
|
-
};
|
|
403
|
-
hotkey: {
|
|
404
|
-
src: "hotkey";
|
|
405
|
-
logic: CallbackActorLogic<EventObject, NonReducibleUnknown, EventObject>;
|
|
406
|
-
id: "hotkey";
|
|
407
|
-
};
|
|
408
|
-
}>, never, Values<{
|
|
409
|
-
"has overlays?": {
|
|
410
|
-
type: "has overlays?";
|
|
411
|
-
params: unknown;
|
|
412
|
-
};
|
|
413
|
-
"close specific overlay?": {
|
|
414
|
-
type: "close specific overlay?";
|
|
415
|
-
params: unknown;
|
|
416
|
-
};
|
|
417
|
-
"last: is relationshipDetails?": {
|
|
418
|
-
type: "last: is relationshipDetails?";
|
|
419
|
-
params: unknown;
|
|
420
|
-
};
|
|
421
|
-
"last: is relationshipsBrowser?": {
|
|
422
|
-
type: "last: is relationshipsBrowser?";
|
|
423
|
-
params: unknown;
|
|
424
|
-
};
|
|
425
|
-
}>, never, OverlayActorEmitedEvent>];
|
|
426
|
-
}>;
|
|
427
|
-
type InferredMachine = typeof _overlaysActorLogic;
|
|
428
|
-
export interface OverlaysActorLogic extends InferredMachine {
|
|
40
|
+
export interface OverlaysActorLogic extends StateMachine<OverlaysContext, OverlayActorEvent, {
|
|
41
|
+
[key: `elementDetails-${number}`]: Overlays.ElementDetails.ActorRef | undefined;
|
|
42
|
+
[key: `relationshipDetails-${number}`]: Overlays.RelationshipDetails.ActorRef | undefined;
|
|
43
|
+
[key: `relationshipsBrowser-${number}`]: Overlays.RelationshipsBrowser.ActorRef | undefined;
|
|
44
|
+
}, any, any, any, any, any, never, never, any, OverlayActorEmitedEvent, any, any> {
|
|
429
45
|
}
|
|
430
46
|
export declare const overlaysActorLogic: OverlaysActorLogic;
|
|
431
47
|
export type OverlaysActorSnapshot = SnapshotFrom<OverlaysActorLogic>;
|
|
432
|
-
export interface OverlaysActorRef extends
|
|
48
|
+
export interface OverlaysActorRef extends ActorRef<OverlaysActorSnapshot, OverlayActorEvent, OverlayActorEmitedEvent> {
|
|
433
49
|
}
|
|
434
|
-
export {};
|
|
@@ -4,6 +4,7 @@ import { setup, fromCallback, assertEvent } from 'xstate';
|
|
|
4
4
|
import { elementDetailsLogic } from './element-details/actor.js';
|
|
5
5
|
import { relationshipDetailsLogic } from './relationship-details/actor.js';
|
|
6
6
|
import { relationshipsBrowserLogic } from './relationships-browser/actor.js';
|
|
7
|
+
import { x as xstateGuards_cjsExports } from '../_virtual/xstate-guards.cjs.js';
|
|
7
8
|
|
|
8
9
|
const hotkeyLogic = fromCallback(({ sendBack }) => {
|
|
9
10
|
const handler = getHotkeyHandler([
|
|
@@ -99,8 +100,8 @@ const openElementDetails = () => machine.enqueueActions(({ context, enqueue, eve
|
|
|
99
100
|
overlays: [
|
|
100
101
|
...context.overlays,
|
|
101
102
|
{
|
|
102
|
-
type: "elementDetails",
|
|
103
103
|
id,
|
|
104
|
+
type: "elementDetails",
|
|
104
105
|
subject: event.subject
|
|
105
106
|
}
|
|
106
107
|
]
|
|
@@ -126,8 +127,8 @@ const openRelationshipDetails = () => machine.enqueueActions(({ context, enqueue
|
|
|
126
127
|
overlays: [
|
|
127
128
|
...context.overlays,
|
|
128
129
|
{
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
id,
|
|
131
|
+
type: "relationshipDetails"
|
|
131
132
|
}
|
|
132
133
|
]
|
|
133
134
|
});
|
|
@@ -153,17 +154,42 @@ const openRelationshipsBrowser = () => machine.enqueueActions(({ context, enqueu
|
|
|
153
154
|
overlays: [
|
|
154
155
|
...context.overlays,
|
|
155
156
|
{
|
|
156
|
-
type: "relationshipsBrowser",
|
|
157
157
|
id,
|
|
158
|
+
type: "relationshipsBrowser",
|
|
158
159
|
subject: event.subject
|
|
159
160
|
}
|
|
160
161
|
]
|
|
161
162
|
});
|
|
162
163
|
});
|
|
164
|
+
const openOverlay = () => machine.enqueueActions(({ enqueue, event }) => {
|
|
165
|
+
console.log("openOverlay event", event);
|
|
166
|
+
assertEvent(event, [
|
|
167
|
+
"open.elementDetails",
|
|
168
|
+
"open.relationshipDetails",
|
|
169
|
+
"open.relationshipsBrowser"
|
|
170
|
+
]);
|
|
171
|
+
switch (event.type) {
|
|
172
|
+
case "open.elementDetails":
|
|
173
|
+
enqueue(openElementDetails());
|
|
174
|
+
break;
|
|
175
|
+
case "open.relationshipDetails":
|
|
176
|
+
enqueue(openRelationshipDetails());
|
|
177
|
+
break;
|
|
178
|
+
case "open.relationshipsBrowser":
|
|
179
|
+
enqueue(openRelationshipsBrowser());
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
163
183
|
const listenToEsc = () => machine.spawnChild("hotkey", {
|
|
164
184
|
id: "hotkey"
|
|
165
185
|
});
|
|
166
186
|
const stopListeningToEsc = () => machine.stopChild("hotkey");
|
|
187
|
+
const checkState = () => machine.enqueueActions(({ enqueue, context }) => {
|
|
188
|
+
if (context.overlays.length === 0) {
|
|
189
|
+
console.log("No overlays left, raising close event");
|
|
190
|
+
enqueue.raise({ type: "close" });
|
|
191
|
+
}
|
|
192
|
+
});
|
|
167
193
|
const _overlaysActorLogic = machine.createMachine({
|
|
168
194
|
id: "overlays",
|
|
169
195
|
context: () => ({
|
|
@@ -171,66 +197,61 @@ const _overlaysActorLogic = machine.createMachine({
|
|
|
171
197
|
overlays: []
|
|
172
198
|
}),
|
|
173
199
|
initial: "idle",
|
|
174
|
-
on: {
|
|
175
|
-
"open.elementDetails": {
|
|
176
|
-
actions: openElementDetails(),
|
|
177
|
-
target: ".active",
|
|
178
|
-
reenter: false
|
|
179
|
-
},
|
|
180
|
-
"open.relationshipDetails": {
|
|
181
|
-
actions: openRelationshipDetails(),
|
|
182
|
-
target: ".active",
|
|
183
|
-
reenter: false
|
|
184
|
-
},
|
|
185
|
-
"open.relationshipsBrowser": {
|
|
186
|
-
actions: openRelationshipsBrowser(),
|
|
187
|
-
target: ".active",
|
|
188
|
-
reenter: false
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
200
|
states: {
|
|
192
|
-
idle: {
|
|
201
|
+
idle: {
|
|
202
|
+
on: {
|
|
203
|
+
"open.*": {
|
|
204
|
+
actions: openOverlay(),
|
|
205
|
+
target: "active"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
193
209
|
active: {
|
|
194
|
-
entry:
|
|
195
|
-
|
|
210
|
+
entry: [
|
|
211
|
+
listenToEsc()
|
|
212
|
+
],
|
|
213
|
+
exit: [
|
|
214
|
+
stopListeningToEsc()
|
|
215
|
+
],
|
|
196
216
|
on: {
|
|
217
|
+
"open.*": {
|
|
218
|
+
actions: openOverlay()
|
|
219
|
+
},
|
|
197
220
|
"close": [
|
|
221
|
+
{
|
|
222
|
+
guard: xstateGuards_cjsExports.not("has overlays?"),
|
|
223
|
+
target: "idle"
|
|
224
|
+
},
|
|
198
225
|
{
|
|
199
226
|
guard: "close specific overlay?",
|
|
200
|
-
actions:
|
|
201
|
-
|
|
227
|
+
actions: [
|
|
228
|
+
closeSpecificOverlay(),
|
|
229
|
+
checkState()
|
|
230
|
+
]
|
|
202
231
|
},
|
|
203
232
|
{
|
|
204
|
-
actions:
|
|
205
|
-
|
|
233
|
+
actions: [
|
|
234
|
+
closeLastOverlay(),
|
|
235
|
+
checkState()
|
|
236
|
+
]
|
|
206
237
|
}
|
|
207
238
|
],
|
|
208
239
|
"close.all": {
|
|
209
240
|
actions: [
|
|
210
|
-
closeAllOverlays()
|
|
211
|
-
stopListeningToEsc()
|
|
241
|
+
closeAllOverlays()
|
|
212
242
|
],
|
|
213
243
|
target: "idle"
|
|
214
244
|
}
|
|
215
245
|
}
|
|
216
246
|
},
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
{
|
|
224
|
-
actions: stopListeningToEsc(),
|
|
225
|
-
target: "idle"
|
|
226
|
-
}
|
|
227
|
-
]
|
|
247
|
+
final: {
|
|
248
|
+
entry: [
|
|
249
|
+
closeAllOverlays(),
|
|
250
|
+
stopListeningToEsc()
|
|
251
|
+
],
|
|
252
|
+
type: "final"
|
|
228
253
|
}
|
|
229
|
-
}
|
|
230
|
-
exit: [
|
|
231
|
-
stopListeningToEsc(),
|
|
232
|
-
closeAllOverlays()
|
|
233
|
-
]
|
|
254
|
+
}
|
|
234
255
|
});
|
|
235
256
|
const overlaysActorLogic = _overlaysActorLogic;
|
|
236
257
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color, DiagramNode, ExclusiveUnion, Fqn, IconUrl, RelationId, RelationshipArrowType, RelationshipLineType,
|
|
1
|
+
import { Color, DiagramNode, ExclusiveUnion, Fqn, IconUrl, MarkdownOrString, RelationId, RelationshipArrowType, RelationshipLineType, ViewId } from '@likec4/core/types';
|
|
2
2
|
import { FunctionComponent } from 'react';
|
|
3
3
|
import { Simplify } from 'type-fest';
|
|
4
4
|
import { BaseEdge, BaseEdgeData, BaseEdgeProps, BaseNode, BaseNodeData, BaseNodeProps, NonOptional } from '../../base/types';
|
|
@@ -11,12 +11,11 @@ export declare namespace RelationshipDetailsTypes {
|
|
|
11
11
|
in: string[];
|
|
12
12
|
out: string[];
|
|
13
13
|
};
|
|
14
|
-
type ElementNodeData = Simplify<BaseNodeData & NonOptional<Pick<DiagramNode, 'id' | 'title' | 'technology' | 'color' | 'shape' | 'width' | 'height' | 'navigateTo' | 'style' | 'tags'>> & {
|
|
14
|
+
type ElementNodeData = Simplify<BaseNodeData & NonOptional<Pick<DiagramNode, 'id' | 'title' | 'technology' | 'description' | 'color' | 'shape' | 'width' | 'height' | 'navigateTo' | 'style' | 'tags'>> & {
|
|
15
15
|
column: Column;
|
|
16
16
|
fqn: Fqn;
|
|
17
17
|
icon: IconUrl;
|
|
18
18
|
ports: Ports;
|
|
19
|
-
description: RichTextOrEmpty;
|
|
20
19
|
}>;
|
|
21
20
|
type CompoundNodeData = Simplify<BaseNodeData & NonOptional<Pick<DiagramNode, 'id' | 'title' | 'color' | 'style'>> & {
|
|
22
21
|
column: Column;
|
|
@@ -51,7 +50,7 @@ export declare namespace RelationshipDetailsTypes {
|
|
|
51
50
|
line: RelationshipLineType;
|
|
52
51
|
head?: RelationshipArrowType;
|
|
53
52
|
tail?: RelationshipArrowType;
|
|
54
|
-
description:
|
|
53
|
+
description: MarkdownOrString | null;
|
|
55
54
|
}>;
|
|
56
55
|
type Edge = BaseEdge<EdgeData, 'relationship'>;
|
|
57
56
|
type EdgeProps = BaseEdgeProps<Edge>;
|