likec4 1.59.3 → 1.60.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/__app__/codegen/react.mjs +6 -6
- package/__app__/codegen/webcomponent.mjs +147 -69
- package/__app__/src/aichat/index.mjs +10 -5
- package/__app__/src/chunks/AIChat.mjs +1134 -693
- package/__app__/src/chunks/LikeC4Styles.mjs +4101 -1737
- package/__app__/src/chunks/ProjectsOverview.mjs +624 -334
- package/__app__/src/chunks/es.mjs +515 -335
- package/__app__/src/chunks/hooks.mjs +578 -366
- package/__app__/src/chunks/libs/@floating-ui.mjs +2720 -1966
- package/__app__/src/chunks/libs/@mantine.mjs +14067 -9487
- package/__app__/src/chunks/libs/@tanstack-ai.mjs +2266 -1146
- package/__app__/src/chunks/libs/@tanstack.mjs +3152 -1932
- package/__app__/src/chunks/libs/@xstate/react.mjs +2924 -1468
- package/__app__/src/chunks/libs/@xyflow/react.mjs +6627 -4067
- package/__app__/src/chunks/libs/bezier-js.mjs +1312 -726
- package/__app__/src/chunks/libs/d3.mjs +3218 -1509
- package/__app__/src/chunks/libs/fast-equals.mjs +437 -201
- package/__app__/src/chunks/libs/framer.mjs +9251 -3846
- package/__app__/src/chunks/libs/nanostores.mjs +174 -0
- package/__app__/src/chunks/libs/zod.mjs +4591 -2363
- package/__app__/src/chunks/rolldown-runtime.mjs +39 -23
- package/__app__/src/chunks/styled-system.mjs +3538 -756
- package/__app__/src/fonts.css +112 -1
- package/__app__/src/main.mjs +44398 -24039
- package/__app__/src/style.css +18488 -1
- package/config/schema.json +136 -97
- package/dist/app/render-view-client.css +1 -1
- package/dist/app/render-view-client.js +506 -338
- package/dist/chunks/enableServer.mjs +1 -1
- package/dist/chunks/filenames.mjs +16 -14
- package/dist/chunks/generate-likec4.mjs +5 -0
- package/dist/chunks/index.d.mts +246 -180
- package/dist/chunks/index2.d.mts +2882 -1977
- package/dist/chunks/libs/@chevrotain/gast.mjs +27 -1
- package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +81 -9
- package/dist/chunks/libs/@chevrotain/types.d.mts +111 -0
- package/dist/chunks/libs/@logtape/logtape.mjs +5 -4
- package/dist/chunks/libs/@lume/kiwi.mjs +1 -1
- package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
- package/dist/chunks/libs/birpc.mjs +1 -1
- package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
- package/dist/chunks/libs/chevrotain.mjs +87 -35
- package/dist/chunks/libs/eventemitter3.mjs +1 -1
- package/dist/chunks/libs/json5.mjs +4 -4
- package/dist/chunks/libs/langium.d.mts +9903 -5297
- package/dist/chunks/libs/langium.mjs +16 -24
- package/dist/chunks/libs/merge-error-cause.mjs +1 -1
- package/dist/chunks/libs/p-limit.mjs +1 -0
- package/dist/chunks/libs/p-queue.mjs +1 -1
- package/dist/chunks/libs/package-manager-detector.mjs +1 -1
- package/dist/chunks/libs/pako.mjs +2 -2
- package/dist/chunks/libs/pretty-ms.mjs +1 -1
- package/dist/chunks/libs/remeda.mjs +1 -1
- package/dist/chunks/libs/ufo.mjs +1 -1
- package/dist/chunks/libs/unstorage.mjs +1 -1
- package/dist/chunks/libs/which.mjs +1 -1
- package/dist/chunks/node.mjs +60 -60
- package/dist/chunks/rolldown-runtime.mjs +1 -1
- package/dist/chunks/sequence-view.mjs +1 -1
- package/dist/chunks/vite-plugin.mjs +55 -52
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +208 -1300
- package/dist/config/index.d.mts +2 -2
- package/dist/generators/likec4.d.mts +6578 -0
- package/dist/generators/likec4.mjs +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/model/index.d.mts +8 -5
- package/dist/vite-plugin/index.d.mts +6 -3
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +9 -0
- package/dist/vite-plugin/internal/index.d.mts +16 -15
- package/dist/vite-plugin/internal/index.mjs +144 -46
- package/generators/likec4/package.json +4 -0
- package/package.json +117 -110
- package/react/index.d.mts +8500 -5399
- package/react/index.mjs +534 -58617
- package/react/rolldown-runtime-DnkiqaRY.js +1 -0
- package/skills/likec4-dsl/SKILL.md +428 -0
- package/skills/likec4-dsl/evals/evals-public.json +202 -0
- package/skills/likec4-dsl/evals/grading-spec.json +589 -0
- package/skills/likec4-dsl/references/bridge-leanix-drawio.md +42 -0
- package/skills/likec4-dsl/references/cli.md +139 -0
- package/skills/likec4-dsl/references/configuration.md +266 -0
- package/skills/likec4-dsl/references/deployment.md +160 -0
- package/skills/likec4-dsl/references/dynamic-views.md +455 -0
- package/skills/likec4-dsl/references/examples.md +370 -0
- package/skills/likec4-dsl/references/identifier-validity.md +90 -0
- package/skills/likec4-dsl/references/include-predicates-wildcards.md +179 -0
- package/skills/likec4-dsl/references/model.md +151 -0
- package/skills/likec4-dsl/references/predicates.md +123 -0
- package/skills/likec4-dsl/references/relationships-bidirectional.md +176 -0
- package/skills/likec4-dsl/references/specification.md +75 -0
- package/skills/likec4-dsl/references/style-tokens-colors.md +150 -0
- package/skills/likec4-dsl/references/troubleshooting.md +96 -0
- package/skills/likec4-dsl/references/views.md +329 -0
- package/vite-plugin-modules.d.ts +4 -2
- package/dist/chunks/libs/picomatch.mjs +0 -1
- package/dist/chunks/libs/zod.d.mts +0 -2140
- package/dist/chunks/libs/zod.mjs +0 -65
|
@@ -1,84 +1,90 @@
|
|
|
1
1
|
import "./rolldown-runtime.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { M as
|
|
6
|
-
import { C as
|
|
7
|
-
import { n as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { a as
|
|
10
|
-
import { createContext
|
|
11
|
-
import { c
|
|
12
|
-
import { jsx
|
|
13
|
-
import { invariant
|
|
14
|
-
import { useLikeC4ProjectsOverview
|
|
2
|
+
import { O as t, w as useSyncedRef } from "./hooks.mjs";
|
|
3
|
+
import { $ as useCallbackRef, D as EnsureMantine, E as FramerMotionConfig, F as Base, P as BaseXYFlow, R as bezierPath, a as ElementNodeContainer, b as useId$1, c as EdgePath, d as EdgeContainer, f as Logo$1, ht as t$1, i as ElementShape, k as RootContainer, l as EdgeLabelContainer, m as useChangeLikeC4Project, n as DefaultHandles, nt as MinZoom, o as ElementData, p as LogoIcon, r as memoEdge, rt as ZIndexes, s as ElementActionButtons, st as IconZoomScan, t as LikeC4Styles, u as EdgeLabel } from "./LikeC4Styles.mjs";
|
|
4
|
+
import { fn as useCallbackRef$1 } from "./libs/@mantine.mjs";
|
|
5
|
+
import { A as createStyleContext, I as cx, M as isCssProperty, t as navigationPanel } from "./styled-system.mjs";
|
|
6
|
+
import { C as getViewportForBounds, c as ReactFlowProvider, d as applyNodeChanges, g as useStoreApi, u as applyEdgeChanges } from "./libs/@xyflow/react.mjs";
|
|
7
|
+
import { n as shallowEqual } from "./libs/fast-equals.mjs";
|
|
8
|
+
import { _ as stagger, d as isValidMotionProp, g as mapValue, i as m, o as animate, p as LayoutGroup, v as styleEffect, y as motionValue } from "./libs/framer.mjs";
|
|
9
|
+
import { a as emit, i as setup, l as assign, n as useSelector, r as assertEvent, t as useActorRef } from "./libs/@xstate/react.mjs";
|
|
10
|
+
import { createContext, forwardRef, memo, useContext, useEffect, useRef } from "react";
|
|
11
|
+
import { c } from "react/compiler-runtime";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { invariant, nonNullable, nonexhaustive } from "@likec4/core";
|
|
14
|
+
import { useLikeC4ProjectsOverview } from "likec4:projects-overview";
|
|
15
15
|
//#region ../diagram/src/projects-overview/layouted-to-xyflow.ts
|
|
16
|
-
function layoutedProjectsViewToXYFlow(
|
|
16
|
+
function layoutedProjectsViewToXYFlow(view) {
|
|
17
17
|
return {
|
|
18
|
-
xynodes: t(
|
|
19
|
-
xyedges: t(
|
|
18
|
+
xynodes: t(view.nodes, projectNodeToXY),
|
|
19
|
+
xyedges: t(view.edges, projectEdgeToXY)
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function projectNodeToXY({ id
|
|
22
|
+
function projectNodeToXY({ id, x, y, width, height, ...node }) {
|
|
23
23
|
return {
|
|
24
|
-
id
|
|
24
|
+
id,
|
|
25
25
|
position: {
|
|
26
|
-
x
|
|
27
|
-
y
|
|
26
|
+
x,
|
|
27
|
+
y
|
|
28
28
|
},
|
|
29
29
|
type: "project",
|
|
30
|
-
initialWidth:
|
|
31
|
-
initialHeight:
|
|
32
|
-
draggable:
|
|
33
|
-
deletable:
|
|
34
|
-
zIndex:
|
|
30
|
+
initialWidth: width,
|
|
31
|
+
initialHeight: height,
|
|
32
|
+
draggable: false,
|
|
33
|
+
deletable: false,
|
|
34
|
+
zIndex: ZIndexes.Element,
|
|
35
35
|
style: {
|
|
36
|
-
width
|
|
37
|
-
height
|
|
36
|
+
width,
|
|
37
|
+
height
|
|
38
38
|
},
|
|
39
39
|
data: {
|
|
40
|
-
id
|
|
41
|
-
width
|
|
42
|
-
height
|
|
43
|
-
...
|
|
40
|
+
id,
|
|
41
|
+
width,
|
|
42
|
+
height,
|
|
43
|
+
...node
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function projectEdgeToXY({ id
|
|
47
|
+
function projectEdgeToXY({ id, source, target, ...edge }) {
|
|
48
48
|
return {
|
|
49
|
-
id
|
|
50
|
-
source
|
|
51
|
-
target
|
|
49
|
+
id,
|
|
50
|
+
source,
|
|
51
|
+
target,
|
|
52
52
|
type: "relationship",
|
|
53
|
-
zIndex:
|
|
54
|
-
deletable:
|
|
53
|
+
zIndex: ZIndexes.Edge,
|
|
54
|
+
deletable: false,
|
|
55
55
|
data: {
|
|
56
|
-
id
|
|
56
|
+
id,
|
|
57
57
|
technology: null,
|
|
58
58
|
labelBBox: null,
|
|
59
|
-
...
|
|
59
|
+
...edge
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
64
|
//#region ../diagram/src/projects-overview/persistence.ts
|
|
65
|
-
var
|
|
65
|
+
var key = `likec4:projects-overview:lastViewport`;
|
|
66
|
+
var ProjectsOverviewViewportPersistence = {
|
|
66
67
|
read() {
|
|
67
68
|
try {
|
|
68
|
-
let
|
|
69
|
-
|
|
69
|
+
let fromStorage = sessionStorage.getItem(key);
|
|
70
|
+
if (fromStorage) return JSON.parse(fromStorage);
|
|
71
|
+
return null;
|
|
70
72
|
} catch (e) {
|
|
71
|
-
|
|
73
|
+
console.error(`Error reading fromStorage ${key}:`, e);
|
|
74
|
+
return null;
|
|
72
75
|
}
|
|
73
76
|
},
|
|
74
|
-
write(
|
|
75
|
-
if (!
|
|
76
|
-
sessionStorage.removeItem(
|
|
77
|
+
write(viewport) {
|
|
78
|
+
if (!viewport) {
|
|
79
|
+
sessionStorage.removeItem(key);
|
|
77
80
|
return;
|
|
78
81
|
}
|
|
79
|
-
sessionStorage.setItem(
|
|
82
|
+
sessionStorage.setItem(key, JSON.stringify(viewport));
|
|
80
83
|
}
|
|
81
|
-
}
|
|
84
|
+
};
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region ../diagram/src/projects-overview/actor.ts
|
|
87
|
+
var machine = setup({
|
|
82
88
|
types: {
|
|
83
89
|
context: {},
|
|
84
90
|
tags: "",
|
|
@@ -87,93 +93,132 @@ var Y = "likec4:projects-overview:lastViewport", X = {
|
|
|
87
93
|
emitted: {}
|
|
88
94
|
},
|
|
89
95
|
guards: {
|
|
90
|
-
isReady: ({ context
|
|
91
|
-
"click: selected node": ({ event
|
|
96
|
+
isReady: ({ context }) => context.initialized.xydata && context.initialized.xyflow && !!context.xystore && !!context.xyflow,
|
|
97
|
+
"click: selected node": ({ event }) => {
|
|
98
|
+
return event.type === "xyflow.click.node" && event.node.selected === true;
|
|
99
|
+
}
|
|
92
100
|
}
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
|
|
101
|
+
});
|
|
102
|
+
var updateView = () => machine.assign(({ event }) => {
|
|
103
|
+
assertEvent(event, "update.view");
|
|
104
|
+
const { xynodes, xyedges } = layoutedProjectsViewToXYFlow(event.view);
|
|
96
105
|
return {
|
|
97
|
-
view:
|
|
98
|
-
xynodes
|
|
99
|
-
xyedges
|
|
106
|
+
view: event.view,
|
|
107
|
+
xynodes,
|
|
108
|
+
xyedges
|
|
100
109
|
};
|
|
101
|
-
})
|
|
102
|
-
|
|
110
|
+
});
|
|
111
|
+
var xyflowApplyNodeChanges = () => machine.assign(({ context, event }) => {
|
|
112
|
+
assertEvent(event, "xyflow.applyNodeChanges");
|
|
113
|
+
return { xynodes: applyNodeChanges(event.changes, context.xynodes) };
|
|
114
|
+
});
|
|
115
|
+
var xyflowApplyEdgeChanges = () => machine.assign(({ context, event }) => {
|
|
116
|
+
assertEvent(event, "xyflow.applyEdgeChanges");
|
|
117
|
+
return { xyedges: applyEdgeChanges(event.changes, context.xyedges) };
|
|
118
|
+
});
|
|
119
|
+
var onMouseEnterOrLeave = () => machine.assign(({ context, event }) => {
|
|
120
|
+
assertEvent(event, [
|
|
103
121
|
"xyflow.mouse.enter.edge",
|
|
104
122
|
"xyflow.mouse.leave.edge",
|
|
105
123
|
"xyflow.mouse.enter.node",
|
|
106
124
|
"xyflow.mouse.leave.node"
|
|
107
125
|
]);
|
|
108
|
-
|
|
109
|
-
switch (
|
|
126
|
+
const isEnter = event.type.startsWith("xyflow.mouse.enter");
|
|
127
|
+
switch (event.type) {
|
|
110
128
|
case "xyflow.mouse.enter.edge":
|
|
111
129
|
case "xyflow.mouse.leave.edge": {
|
|
112
|
-
|
|
113
|
-
return { xyedges:
|
|
130
|
+
const edgeId = event.edge.id;
|
|
131
|
+
return { xyedges: context.xyedges.map((e) => {
|
|
132
|
+
if (e.id === edgeId) return Base.setHovered(e, isEnter);
|
|
133
|
+
return e;
|
|
134
|
+
}) };
|
|
114
135
|
}
|
|
115
136
|
case "xyflow.mouse.enter.node":
|
|
116
137
|
case "xyflow.mouse.leave.node": {
|
|
117
|
-
|
|
118
|
-
return { xynodes:
|
|
138
|
+
const nodeId = event.node.id;
|
|
139
|
+
return { xynodes: context.xynodes.map((n) => {
|
|
140
|
+
if (n.id === nodeId) return Base.setHovered(n, isEnter);
|
|
141
|
+
return n;
|
|
142
|
+
}) };
|
|
119
143
|
}
|
|
120
|
-
default:
|
|
144
|
+
default: nonexhaustive(event);
|
|
121
145
|
}
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
146
|
+
});
|
|
147
|
+
var saveViewport = () => machine.createAction(({ context }) => {
|
|
148
|
+
const xyflow = context.xyflow;
|
|
149
|
+
if (xyflow) ProjectsOverviewViewportPersistence.write(xyflow.getViewport());
|
|
150
|
+
});
|
|
151
|
+
var handleClick = () => machine.enqueueActions(({ event, enqueue }) => {
|
|
152
|
+
if (event.type === "xyflow.click.double") {
|
|
153
|
+
enqueue(fitDiagram());
|
|
128
154
|
return;
|
|
129
155
|
}
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
let
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
duration
|
|
156
|
+
});
|
|
157
|
+
var fitDiagram = (params) => machine.enqueueActions(({ context, event }) => {
|
|
158
|
+
let bounds = context.view.bounds;
|
|
159
|
+
let duration;
|
|
160
|
+
if (params) {
|
|
161
|
+
bounds = params.bounds ?? context.view.bounds;
|
|
162
|
+
duration = params.duration;
|
|
163
|
+
} else if (event.type === "xyflow.fitDiagram") {
|
|
164
|
+
bounds = event.bounds ?? context.view.bounds;
|
|
165
|
+
duration = event.duration;
|
|
166
|
+
}
|
|
167
|
+
duration ??= 450;
|
|
168
|
+
const { width, height, panZoom, transform } = nonNullable(context.xystore).getState();
|
|
169
|
+
const maxZoom = Math.max(1, transform[2]);
|
|
170
|
+
const viewport = getViewportForBounds(bounds, width, height, MinZoom, maxZoom, context.fitViewPadding);
|
|
171
|
+
viewport.x = Math.round(viewport.x);
|
|
172
|
+
viewport.y = Math.round(viewport.y);
|
|
173
|
+
const animationProps = duration > 0 ? {
|
|
174
|
+
duration,
|
|
137
175
|
interpolate: "smooth"
|
|
138
176
|
} : void 0;
|
|
139
|
-
|
|
140
|
-
console.error("Error during fitDiagram panZoom setViewport", { err
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
177
|
+
panZoom?.setViewport(viewport, animationProps).catch((err) => {
|
|
178
|
+
console.error("Error during fitDiagram panZoom setViewport", { err });
|
|
179
|
+
});
|
|
180
|
+
ProjectsOverviewViewportPersistence.write(null);
|
|
181
|
+
});
|
|
182
|
+
var restoreViewport = () => machine.enqueueActions(({ context, enqueue }) => {
|
|
183
|
+
const viewport = ProjectsOverviewViewportPersistence.read();
|
|
184
|
+
if (viewport) {
|
|
185
|
+
nonNullable(context.xyflow).setViewport(viewport, { duration: 0 });
|
|
146
186
|
return;
|
|
147
187
|
}
|
|
148
|
-
|
|
149
|
-
})
|
|
188
|
+
enqueue(fitDiagram({ duration: 0 }));
|
|
189
|
+
});
|
|
190
|
+
var dispose = () => machine.assign({
|
|
150
191
|
xyflow: null,
|
|
151
192
|
xystore: null,
|
|
152
193
|
initialized: {
|
|
153
|
-
xyflow:
|
|
154
|
-
xydata:
|
|
194
|
+
xyflow: false,
|
|
195
|
+
xydata: false
|
|
155
196
|
},
|
|
156
197
|
xyedges: [],
|
|
157
198
|
xynodes: []
|
|
158
|
-
})
|
|
159
|
-
|
|
160
|
-
|
|
199
|
+
});
|
|
200
|
+
var assignNavigateTo = () => machine.assign(({ event, context }) => {
|
|
201
|
+
let navigateTo;
|
|
202
|
+
switch (event.type) {
|
|
161
203
|
case "xyflow.click.node":
|
|
162
|
-
|
|
204
|
+
navigateTo = event.node;
|
|
163
205
|
break;
|
|
164
206
|
case "navigate.to":
|
|
165
|
-
|
|
207
|
+
navigateTo = nonNullable(context.xynodes.find((n) => n.id === event.fromNode), `Node ${event.fromNode} not found`);
|
|
166
208
|
break;
|
|
167
|
-
default:
|
|
209
|
+
default:
|
|
210
|
+
console.warn(`Unexpected event ${event.type} in assignNavigateTo`);
|
|
211
|
+
return {};
|
|
168
212
|
}
|
|
169
|
-
return { navigateTo
|
|
170
|
-
})
|
|
213
|
+
return { navigateTo };
|
|
214
|
+
});
|
|
215
|
+
var projectOverviewLogic = machine.createMachine({
|
|
171
216
|
id: "projects-overview",
|
|
172
|
-
context: ({ input
|
|
173
|
-
...
|
|
217
|
+
context: ({ input }) => ({
|
|
218
|
+
...input,
|
|
174
219
|
initialized: {
|
|
175
|
-
xydata:
|
|
176
|
-
xyflow:
|
|
220
|
+
xydata: false,
|
|
221
|
+
xyflow: false
|
|
177
222
|
},
|
|
178
223
|
xyflow: null,
|
|
179
224
|
xystore: null,
|
|
@@ -181,24 +226,24 @@ var Y = "likec4:projects-overview:lastViewport", X = {
|
|
|
181
226
|
xyedges: []
|
|
182
227
|
}),
|
|
183
228
|
initial: "init",
|
|
184
|
-
on: { close: { target: ".closed" } },
|
|
229
|
+
on: { "close": { target: ".closed" } },
|
|
185
230
|
states: {
|
|
186
231
|
init: { on: {
|
|
187
232
|
"update.view": {
|
|
188
|
-
actions: [updateView(),
|
|
189
|
-
...
|
|
190
|
-
xydata:
|
|
233
|
+
actions: [updateView(), assign(({ context }) => ({ initialized: {
|
|
234
|
+
...context.initialized,
|
|
235
|
+
xydata: true
|
|
191
236
|
} }))],
|
|
192
237
|
target: "isReady"
|
|
193
238
|
},
|
|
194
239
|
"xyflow.init": {
|
|
195
|
-
actions: [
|
|
240
|
+
actions: [assign(({ context, event }) => ({
|
|
196
241
|
initialized: {
|
|
197
|
-
...
|
|
198
|
-
xyflow:
|
|
242
|
+
...context.initialized,
|
|
243
|
+
xyflow: true
|
|
199
244
|
},
|
|
200
|
-
xyflow:
|
|
201
|
-
xystore:
|
|
245
|
+
xyflow: event.xyflow,
|
|
246
|
+
xystore: event.xystore
|
|
202
247
|
}))],
|
|
203
248
|
target: "isReady"
|
|
204
249
|
}
|
|
@@ -231,39 +276,53 @@ var Y = "likec4:projects-overview:lastViewport", X = {
|
|
|
231
276
|
tags: "active",
|
|
232
277
|
entry: [
|
|
233
278
|
saveViewport(),
|
|
234
|
-
|
|
235
|
-
({ context: { navigateTo
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
279
|
+
assign({ xyedges: [] }),
|
|
280
|
+
({ context: { navigateTo, xyflow, xystore }, self }) => {
|
|
281
|
+
invariant(xyflow && navigateTo, "Invalid state, xyflow is undefined");
|
|
282
|
+
const { width, domNode } = nonNullable(xystore).getState();
|
|
283
|
+
const nextZoom = t$1(Math.min(width * 7 / 9 / navigateTo.data.width), {
|
|
284
|
+
min: MinZoom,
|
|
239
285
|
max: 2.5
|
|
240
|
-
})
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
286
|
+
});
|
|
287
|
+
const next = {
|
|
288
|
+
x: Math.round(-nextZoom * navigateTo.position.x + (width - nextZoom * navigateTo.data.width) / 2),
|
|
289
|
+
y: Math.round(-nextZoom * navigateTo.position.y) + 50
|
|
290
|
+
};
|
|
291
|
+
const current = xyflow.getViewport();
|
|
292
|
+
const otherNodes = domNode.querySelectorAll(`.react-flow__node-project:not([data-id="${navigateTo.id}"]) > *`);
|
|
293
|
+
const otherNodesAnimation = animate(otherNodes, {
|
|
244
294
|
opacity: 0,
|
|
245
295
|
scale: .9
|
|
246
296
|
}, {
|
|
247
297
|
visualDuration: .25,
|
|
248
|
-
delay:
|
|
249
|
-
})
|
|
250
|
-
|
|
298
|
+
delay: stagger(.08, { from: "center" })
|
|
299
|
+
});
|
|
300
|
+
const v = motionValue(1);
|
|
301
|
+
const transform = mapValue(v, [1, 0], [`translate(${current.x}px, ${current.y}px) scale(${current.zoom})`, `translate(${next.x}px, ${next.y}px) scale(${nextZoom})`]);
|
|
302
|
+
const cancelViewportAnimation = styleEffect(domNode.querySelector(".xyflow__viewport"), { transform });
|
|
303
|
+
const cancelOpacityAnimation = styleEffect(domNode.querySelector(`.react-flow__node-project:is([data-id="${navigateTo.id}"]) > *`), { opacity: v });
|
|
304
|
+
const targetAnimation = animate(v, 0, {
|
|
305
|
+
delay: otherNodes.length > 3 ? .25 : 0,
|
|
251
306
|
type: "spring",
|
|
252
307
|
stiffness: 350,
|
|
253
308
|
damping: 40,
|
|
254
309
|
mass: 1.5,
|
|
255
310
|
visualDuration: .55
|
|
256
311
|
});
|
|
257
|
-
Promise.race([
|
|
258
|
-
|
|
312
|
+
Promise.race([targetAnimation.finished, sleep(750)]).then(() => {
|
|
313
|
+
cancelViewportAnimation();
|
|
314
|
+
cancelOpacityAnimation();
|
|
315
|
+
targetAnimation.stop();
|
|
316
|
+
otherNodesAnimation.stop();
|
|
317
|
+
self.send({
|
|
259
318
|
type: "emit.navigate.to",
|
|
260
|
-
projectId:
|
|
319
|
+
projectId: navigateTo.data.projectId
|
|
261
320
|
});
|
|
262
321
|
});
|
|
263
322
|
}
|
|
264
323
|
],
|
|
265
|
-
on: { "emit.navigate.to": { actions:
|
|
266
|
-
...
|
|
324
|
+
on: { "emit.navigate.to": { actions: emit(({ event }) => ({
|
|
325
|
+
...event,
|
|
267
326
|
type: "navigate.to"
|
|
268
327
|
})) } }
|
|
269
328
|
},
|
|
@@ -274,264 +333,495 @@ var Y = "likec4:projects-overview:lastViewport", X = {
|
|
|
274
333
|
}
|
|
275
334
|
}
|
|
276
335
|
});
|
|
277
|
-
function sleep(
|
|
278
|
-
return new Promise((
|
|
336
|
+
function sleep(ms) {
|
|
337
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
279
338
|
}
|
|
280
339
|
//#endregion
|
|
281
340
|
//#region ../diagram/src/projects-overview/context.ts
|
|
282
|
-
var
|
|
341
|
+
var ProjectsOverviewActorContext = createContext(null);
|
|
342
|
+
var ProjectsOverviewActorContextProvider = ProjectsOverviewActorContext.Provider;
|
|
283
343
|
function useProjectsOverviewActor() {
|
|
284
|
-
|
|
285
|
-
|
|
344
|
+
const $ = c(2);
|
|
345
|
+
const t0 = useContext(ProjectsOverviewActorContext);
|
|
346
|
+
let t1;
|
|
347
|
+
if ($[0] !== t0) {
|
|
348
|
+
t1 = nonNullable(t0, "No ProjectsOverviewActorContext");
|
|
349
|
+
$[0] = t0;
|
|
350
|
+
$[1] = t1;
|
|
351
|
+
} else t1 = $[1];
|
|
352
|
+
return t1;
|
|
286
353
|
}
|
|
287
354
|
//#endregion
|
|
355
|
+
//#region ../diagram/src/components/NavigationPanel.tsx
|
|
356
|
+
var { withProvider, withContext } = createStyleContext(navigationPanel);
|
|
357
|
+
var shouldForwardProp = (prop, variantKeys) => !variantKeys.includes(prop) && (isValidMotionProp(prop) || !isCssProperty(prop));
|
|
358
|
+
var LogoButton = forwardRef((t0, ref) => {
|
|
359
|
+
const $ = c(11);
|
|
360
|
+
let className;
|
|
361
|
+
let props;
|
|
362
|
+
if ($[0] !== t0) {
|
|
363
|
+
({className, ...props} = t0);
|
|
364
|
+
$[0] = t0;
|
|
365
|
+
$[1] = className;
|
|
366
|
+
$[2] = props;
|
|
367
|
+
} else {
|
|
368
|
+
className = $[1];
|
|
369
|
+
props = $[2];
|
|
370
|
+
}
|
|
371
|
+
let t1;
|
|
372
|
+
if ($[3] !== className) {
|
|
373
|
+
t1 = cx("mantine-active", className);
|
|
374
|
+
$[3] = className;
|
|
375
|
+
$[4] = t1;
|
|
376
|
+
} else t1 = $[4];
|
|
377
|
+
let t2;
|
|
378
|
+
let t3;
|
|
379
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
380
|
+
t2 = /* @__PURE__ */ jsx(LogoIcon, { "data-logo-icon": true });
|
|
381
|
+
t3 = /* @__PURE__ */ jsx(Logo$1, { "data-logo-full": true });
|
|
382
|
+
$[5] = t2;
|
|
383
|
+
$[6] = t3;
|
|
384
|
+
} else {
|
|
385
|
+
t2 = $[5];
|
|
386
|
+
t3 = $[6];
|
|
387
|
+
}
|
|
388
|
+
let t4;
|
|
389
|
+
if ($[7] !== props || $[8] !== ref || $[9] !== t1) {
|
|
390
|
+
t4 = /* @__PURE__ */ jsxs("button", {
|
|
391
|
+
...props,
|
|
392
|
+
ref,
|
|
393
|
+
className: t1,
|
|
394
|
+
children: [t2, t3]
|
|
395
|
+
});
|
|
396
|
+
$[7] = props;
|
|
397
|
+
$[8] = ref;
|
|
398
|
+
$[9] = t1;
|
|
399
|
+
$[10] = t4;
|
|
400
|
+
} else t4 = $[10];
|
|
401
|
+
return t4;
|
|
402
|
+
});
|
|
403
|
+
var NavigationPanel = {
|
|
404
|
+
Root: withProvider(m.div, "root", { shouldForwardProp }),
|
|
405
|
+
Body: withContext(m.div, "body", { shouldForwardProp }),
|
|
406
|
+
Logo: withContext(LogoButton, "logo", { shouldForwardProp }),
|
|
407
|
+
Label: withContext(m.div, "label", { shouldForwardProp }),
|
|
408
|
+
Dropdown: withContext(m.div, "dropdown", { shouldForwardProp })
|
|
409
|
+
};
|
|
410
|
+
//#endregion
|
|
288
411
|
//#region ../diagram/src/projects-overview/panel/ProjectsOverviewPanel.tsx
|
|
289
412
|
var ProjectsOverviewPanel = () => {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
413
|
+
const $ = c(1);
|
|
414
|
+
let t0;
|
|
415
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
416
|
+
t0 = /* @__PURE__ */ jsx(NavigationPanel.Root, { children: /* @__PURE__ */ jsxs(NavigationPanel.Body, { children: [/* @__PURE__ */ jsx(NavigationPanel.Logo, {}), /* @__PURE__ */ jsx(NavigationPanel.Label, { children: "Projects Overview" })] }) });
|
|
417
|
+
$[0] = t0;
|
|
418
|
+
} else t0 = $[0];
|
|
419
|
+
return t0;
|
|
420
|
+
};
|
|
421
|
+
//#endregion
|
|
422
|
+
//#region ../diagram/src/projects-overview/custom/edgeTypes.tsx
|
|
423
|
+
var RelationshipEdge = memoEdge((edgeProps) => {
|
|
424
|
+
const path = bezierPath(edgeProps.data.points);
|
|
425
|
+
return /* @__PURE__ */ jsxs(EdgeContainer, {
|
|
426
|
+
...edgeProps,
|
|
427
|
+
children: [/* @__PURE__ */ jsx(EdgePath, {
|
|
428
|
+
edgeProps,
|
|
429
|
+
svgPath: path
|
|
430
|
+
}), /* @__PURE__ */ jsx(EdgeLabelContainer, {
|
|
431
|
+
edgeProps,
|
|
432
|
+
children: /* @__PURE__ */ jsx(EdgeLabel, { edgeProps })
|
|
302
433
|
})]
|
|
303
434
|
});
|
|
304
435
|
});
|
|
305
436
|
//#endregion
|
|
306
437
|
//#region ../diagram/src/projects-overview/custom/nodeTypes.tsx
|
|
307
|
-
function ProjectNode(
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
438
|
+
function ProjectNode(props) {
|
|
439
|
+
const $ = c(19);
|
|
440
|
+
const actor = useProjectsOverviewActor();
|
|
441
|
+
let t0;
|
|
442
|
+
if ($[0] !== actor || $[1] !== props.data.id || $[2] !== props.data.projectId) {
|
|
443
|
+
t0 = (e) => {
|
|
444
|
+
e.stopPropagation();
|
|
445
|
+
actor.send({
|
|
446
|
+
type: "navigate.to",
|
|
447
|
+
fromNode: props.data.id,
|
|
448
|
+
projectId: props.data.projectId
|
|
449
|
+
});
|
|
450
|
+
};
|
|
451
|
+
$[0] = actor;
|
|
452
|
+
$[1] = props.data.id;
|
|
453
|
+
$[2] = props.data.projectId;
|
|
454
|
+
$[3] = t0;
|
|
455
|
+
} else t0 = $[3];
|
|
456
|
+
const navigateTo = useCallbackRef$1(t0);
|
|
457
|
+
let t1;
|
|
458
|
+
let t2;
|
|
459
|
+
if ($[4] !== props) {
|
|
460
|
+
t1 = /* @__PURE__ */ jsx(ElementShape, { ...props });
|
|
461
|
+
t2 = /* @__PURE__ */ jsx(ElementData, { ...props });
|
|
462
|
+
$[4] = props;
|
|
463
|
+
$[5] = t1;
|
|
464
|
+
$[6] = t2;
|
|
465
|
+
} else {
|
|
466
|
+
t1 = $[5];
|
|
467
|
+
t2 = $[6];
|
|
468
|
+
}
|
|
469
|
+
let t3;
|
|
470
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
471
|
+
t3 = /* @__PURE__ */ jsx(IconZoomScan, {});
|
|
472
|
+
$[7] = t3;
|
|
473
|
+
} else t3 = $[7];
|
|
474
|
+
let t4;
|
|
475
|
+
if ($[8] !== navigateTo) {
|
|
476
|
+
t4 = [{
|
|
477
|
+
key: "navigate",
|
|
478
|
+
icon: t3,
|
|
479
|
+
onClick: navigateTo
|
|
480
|
+
}];
|
|
481
|
+
$[8] = navigateTo;
|
|
482
|
+
$[9] = t4;
|
|
483
|
+
} else t4 = $[9];
|
|
484
|
+
let t5;
|
|
485
|
+
if ($[10] !== props || $[11] !== t4) {
|
|
486
|
+
t5 = /* @__PURE__ */ jsx(ElementActionButtons, {
|
|
487
|
+
...props,
|
|
488
|
+
buttons: t4
|
|
314
489
|
});
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}, e.id), t[14] = e, t[15] = i, t[16] = a, t[17] = c, t[18] = p) : p = t[18], p;
|
|
490
|
+
$[10] = props;
|
|
491
|
+
$[11] = t4;
|
|
492
|
+
$[12] = t5;
|
|
493
|
+
} else t5 = $[12];
|
|
494
|
+
let t6;
|
|
495
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
496
|
+
t6 = /* @__PURE__ */ jsx(DefaultHandles, {});
|
|
497
|
+
$[13] = t6;
|
|
498
|
+
} else t6 = $[13];
|
|
499
|
+
let t7;
|
|
500
|
+
if ($[14] !== props || $[15] !== t1 || $[16] !== t2 || $[17] !== t5) {
|
|
501
|
+
t7 = /* @__PURE__ */ jsxs(ElementNodeContainer, {
|
|
502
|
+
layout: true,
|
|
503
|
+
nodeProps: props,
|
|
504
|
+
children: [
|
|
505
|
+
t1,
|
|
506
|
+
t2,
|
|
507
|
+
t5,
|
|
508
|
+
t6
|
|
509
|
+
]
|
|
510
|
+
}, props.id);
|
|
511
|
+
$[14] = props;
|
|
512
|
+
$[15] = t1;
|
|
513
|
+
$[16] = t2;
|
|
514
|
+
$[17] = t5;
|
|
515
|
+
$[18] = t7;
|
|
516
|
+
} else t7 = $[18];
|
|
517
|
+
return t7;
|
|
344
518
|
}
|
|
345
519
|
//#endregion
|
|
346
520
|
//#region ../diagram/src/projects-overview/hooks.ts
|
|
347
|
-
function useProjectsOverviewState(
|
|
348
|
-
|
|
349
|
-
|
|
521
|
+
function useProjectsOverviewState(selector, t0) {
|
|
522
|
+
const compare = t0 === void 0 ? shallowEqual : t0;
|
|
523
|
+
const actor = useProjectsOverviewActor();
|
|
524
|
+
return useSelector(actor, selector, compare);
|
|
350
525
|
}
|
|
351
526
|
function useProjectsOverviewXYStoreApi() {
|
|
352
|
-
return
|
|
527
|
+
return useStoreApi();
|
|
353
528
|
}
|
|
354
529
|
//#endregion
|
|
355
530
|
//#region ../diagram/src/projects-overview/ProjectsOverviewXY.tsx
|
|
356
|
-
var
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
531
|
+
var nodeTypes = { project: ProjectNode };
|
|
532
|
+
var edgeTypes = { relationship: RelationshipEdge };
|
|
533
|
+
var selector = (state) => ({
|
|
534
|
+
isActive: state.hasTag("active"),
|
|
535
|
+
nodes: state.context.xynodes,
|
|
536
|
+
edges: state.context.xyedges
|
|
537
|
+
});
|
|
538
|
+
var selectorEq = (a, b) => a.isActive === b.isActive && shallowEqual(a.nodes, b.nodes) && shallowEqual(a.edges, b.edges);
|
|
539
|
+
var ProjectsOverviewXY = memo((t0) => {
|
|
540
|
+
const $ = c(45);
|
|
541
|
+
let props;
|
|
542
|
+
let t1;
|
|
543
|
+
if ($[0] !== t0) {
|
|
544
|
+
({background: t1, ...props} = t0);
|
|
545
|
+
$[0] = t0;
|
|
546
|
+
$[1] = props;
|
|
547
|
+
$[2] = t1;
|
|
548
|
+
} else {
|
|
549
|
+
props = $[1];
|
|
550
|
+
t1 = $[2];
|
|
551
|
+
}
|
|
552
|
+
const background = t1 === void 0 ? "dots" : t1;
|
|
553
|
+
const actorRef = useProjectsOverviewActor();
|
|
554
|
+
const { isActive, nodes, edges } = useProjectsOverviewState(selector, selectorEq);
|
|
555
|
+
const xystore = useProjectsOverviewXYStoreApi();
|
|
556
|
+
const t2 = isActive ? "initialized" : "not-initialized";
|
|
557
|
+
let t3;
|
|
558
|
+
if ($[3] !== t2) {
|
|
559
|
+
t3 = cx(t2, "projects-overview");
|
|
560
|
+
$[3] = t2;
|
|
561
|
+
$[4] = t3;
|
|
562
|
+
} else t3 = $[4];
|
|
365
563
|
let t4;
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
let
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
564
|
+
if ($[5] !== actorRef) {
|
|
565
|
+
t4 = (_e, node) => {
|
|
566
|
+
_e.stopPropagation();
|
|
567
|
+
actorRef.send({
|
|
568
|
+
type: "xyflow.click.node",
|
|
569
|
+
node
|
|
570
|
+
});
|
|
571
|
+
};
|
|
572
|
+
$[5] = actorRef;
|
|
573
|
+
$[6] = t4;
|
|
574
|
+
} else t4 = $[6];
|
|
575
|
+
const t5 = useCallbackRef(t4);
|
|
576
|
+
let t6;
|
|
577
|
+
if ($[7] !== actorRef) {
|
|
578
|
+
t6 = (_e_0, edge) => {
|
|
579
|
+
_e_0.stopPropagation();
|
|
580
|
+
actorRef.send({
|
|
581
|
+
type: "xyflow.click.edge",
|
|
582
|
+
edge
|
|
583
|
+
});
|
|
584
|
+
};
|
|
585
|
+
$[7] = actorRef;
|
|
586
|
+
$[8] = t6;
|
|
587
|
+
} else t6 = $[8];
|
|
588
|
+
const t7 = useCallbackRef(t6);
|
|
589
|
+
let t8;
|
|
590
|
+
if ($[9] !== actorRef) {
|
|
591
|
+
t8 = (_e_1) => {
|
|
592
|
+
_e_1.stopPropagation();
|
|
593
|
+
actorRef.send({ type: "xyflow.click.pane" });
|
|
594
|
+
};
|
|
595
|
+
$[9] = actorRef;
|
|
596
|
+
$[10] = t8;
|
|
597
|
+
} else t8 = $[10];
|
|
598
|
+
const t9 = useCallbackRef(t8);
|
|
599
|
+
let t10;
|
|
600
|
+
if ($[11] !== actorRef) {
|
|
601
|
+
t10 = (_e_2) => {
|
|
602
|
+
_e_2.stopPropagation();
|
|
603
|
+
actorRef.send({ type: "xyflow.click.double" });
|
|
604
|
+
};
|
|
605
|
+
$[11] = actorRef;
|
|
606
|
+
$[12] = t10;
|
|
607
|
+
} else t10 = $[12];
|
|
608
|
+
const t11 = useCallbackRef(t10);
|
|
609
|
+
let t12;
|
|
610
|
+
if ($[13] !== actorRef) {
|
|
611
|
+
t12 = (changes) => {
|
|
612
|
+
actorRef.send({
|
|
613
|
+
type: "xyflow.applyNodeChanges",
|
|
614
|
+
changes
|
|
615
|
+
});
|
|
616
|
+
};
|
|
617
|
+
$[13] = actorRef;
|
|
618
|
+
$[14] = t12;
|
|
619
|
+
} else t12 = $[14];
|
|
620
|
+
const t13 = useCallbackRef(t12);
|
|
621
|
+
let t14;
|
|
622
|
+
if ($[15] !== actorRef) {
|
|
623
|
+
t14 = (changes_0) => {
|
|
624
|
+
actorRef.send({
|
|
625
|
+
type: "xyflow.applyEdgeChanges",
|
|
626
|
+
changes: changes_0
|
|
627
|
+
});
|
|
628
|
+
};
|
|
629
|
+
$[15] = actorRef;
|
|
630
|
+
$[16] = t14;
|
|
631
|
+
} else t14 = $[16];
|
|
632
|
+
const t15 = useCallbackRef(t14);
|
|
633
|
+
let t16;
|
|
634
|
+
if ($[17] !== actorRef) {
|
|
635
|
+
t16 = (event, edge_0) => {
|
|
636
|
+
actorRef.send({
|
|
637
|
+
type: "xyflow.mouse.enter.edge",
|
|
638
|
+
edge: edge_0,
|
|
639
|
+
event
|
|
640
|
+
});
|
|
641
|
+
};
|
|
642
|
+
$[17] = actorRef;
|
|
643
|
+
$[18] = t16;
|
|
644
|
+
} else t16 = $[18];
|
|
645
|
+
const t17 = useCallbackRef(t16);
|
|
646
|
+
let t18;
|
|
647
|
+
if ($[19] !== actorRef) {
|
|
648
|
+
t18 = (event_0, edge_1) => {
|
|
649
|
+
actorRef.send({
|
|
650
|
+
type: "xyflow.mouse.leave.edge",
|
|
651
|
+
edge: edge_1,
|
|
652
|
+
event: event_0
|
|
653
|
+
});
|
|
654
|
+
};
|
|
655
|
+
$[19] = actorRef;
|
|
656
|
+
$[20] = t18;
|
|
657
|
+
} else t18 = $[20];
|
|
658
|
+
const t19 = useCallbackRef(t18);
|
|
659
|
+
let t20;
|
|
660
|
+
if ($[21] !== actorRef) {
|
|
661
|
+
t20 = (event_1, node_0) => {
|
|
662
|
+
actorRef.send({
|
|
663
|
+
type: "xyflow.mouse.enter.node",
|
|
664
|
+
node: node_0
|
|
665
|
+
});
|
|
666
|
+
};
|
|
667
|
+
$[21] = actorRef;
|
|
668
|
+
$[22] = t20;
|
|
669
|
+
} else t20 = $[22];
|
|
670
|
+
const t21 = useCallbackRef(t20);
|
|
671
|
+
let t22;
|
|
672
|
+
if ($[23] !== actorRef) {
|
|
673
|
+
t22 = (event_2, node_1) => {
|
|
674
|
+
actorRef.send({
|
|
675
|
+
type: "xyflow.mouse.leave.node",
|
|
676
|
+
node: node_1
|
|
677
|
+
});
|
|
678
|
+
};
|
|
679
|
+
$[23] = actorRef;
|
|
680
|
+
$[24] = t22;
|
|
681
|
+
} else t22 = $[24];
|
|
682
|
+
const t23 = useCallbackRef(t22);
|
|
683
|
+
let t24;
|
|
684
|
+
if ($[25] !== actorRef || $[26] !== xystore) {
|
|
685
|
+
t24 = (xyflow) => {
|
|
686
|
+
actorRef.send({
|
|
687
|
+
type: "xyflow.init",
|
|
688
|
+
xyflow,
|
|
689
|
+
xystore
|
|
690
|
+
});
|
|
691
|
+
};
|
|
692
|
+
$[25] = actorRef;
|
|
693
|
+
$[26] = xystore;
|
|
694
|
+
$[27] = t24;
|
|
695
|
+
} else t24 = $[27];
|
|
696
|
+
const t25 = useCallbackRef(t24);
|
|
697
|
+
let t26;
|
|
698
|
+
if ($[28] !== background || $[29] !== edges || $[30] !== nodes || $[31] !== props || $[32] !== t11 || $[33] !== t13 || $[34] !== t15 || $[35] !== t17 || $[36] !== t19 || $[37] !== t21 || $[38] !== t23 || $[39] !== t25 || $[40] !== t3 || $[41] !== t5 || $[42] !== t7 || $[43] !== t9) {
|
|
699
|
+
t26 = /* @__PURE__ */ jsx(BaseXYFlow, {
|
|
700
|
+
nodes,
|
|
701
|
+
edges,
|
|
702
|
+
className: t3,
|
|
703
|
+
nodeTypes,
|
|
704
|
+
edgeTypes,
|
|
705
|
+
fitView: false,
|
|
706
|
+
onNodeClick: t5,
|
|
707
|
+
onEdgeClick: t7,
|
|
708
|
+
onPaneClick: t9,
|
|
709
|
+
onDoubleClick: t11,
|
|
710
|
+
onNodesChange: t13,
|
|
711
|
+
onEdgesChange: t15,
|
|
712
|
+
onEdgeMouseEnter: t17,
|
|
713
|
+
onEdgeMouseLeave: t19,
|
|
714
|
+
onNodeMouseEnter: t21,
|
|
715
|
+
onNodeMouseLeave: t23,
|
|
716
|
+
onInit: t25,
|
|
717
|
+
nodesDraggable: false,
|
|
718
|
+
nodesSelectable: true,
|
|
719
|
+
pannable: true,
|
|
720
|
+
zoomable: true,
|
|
721
|
+
background,
|
|
722
|
+
...props
|
|
437
723
|
});
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
onInit: w,
|
|
458
|
-
nodesDraggable: !1,
|
|
459
|
-
nodesSelectable: !0,
|
|
460
|
-
pannable: !0,
|
|
461
|
-
zoomable: !0,
|
|
462
|
-
background: a,
|
|
463
|
-
...n
|
|
464
|
-
}), t[28] = a, t[29] = l, t[30] = c, t[31] = n, t[32] = g, t[33] = _, t[34] = v, t[35] = y, t[36] = b, t[37] = x, t[38] = S, t[39] = w, t[40] = f, t[41] = p, t[42] = m, t[43] = h, t[44] = T) : T = t[44], T;
|
|
724
|
+
$[28] = background;
|
|
725
|
+
$[29] = edges;
|
|
726
|
+
$[30] = nodes;
|
|
727
|
+
$[31] = props;
|
|
728
|
+
$[32] = t11;
|
|
729
|
+
$[33] = t13;
|
|
730
|
+
$[34] = t15;
|
|
731
|
+
$[35] = t17;
|
|
732
|
+
$[36] = t19;
|
|
733
|
+
$[37] = t21;
|
|
734
|
+
$[38] = t23;
|
|
735
|
+
$[39] = t25;
|
|
736
|
+
$[40] = t3;
|
|
737
|
+
$[41] = t5;
|
|
738
|
+
$[42] = t7;
|
|
739
|
+
$[43] = t9;
|
|
740
|
+
$[44] = t26;
|
|
741
|
+
} else t26 = $[44];
|
|
742
|
+
return t26;
|
|
465
743
|
});
|
|
466
|
-
|
|
744
|
+
ProjectsOverviewXY.displayName = "ProjectsOverviewXY";
|
|
467
745
|
//#endregion
|
|
468
746
|
//#region ../diagram/src/projects-overview/ProjectsOverview.tsx
|
|
469
|
-
function ProjectsOverview({ view
|
|
747
|
+
function ProjectsOverview({ view, onNavigateToProject, fitViewPadding = {
|
|
470
748
|
top: "50px",
|
|
471
749
|
bottom: "32px",
|
|
472
750
|
left: "32px",
|
|
473
751
|
right: "32px"
|
|
474
|
-
}, ...
|
|
475
|
-
|
|
476
|
-
view
|
|
477
|
-
fitViewPadding
|
|
752
|
+
}, ...props }) {
|
|
753
|
+
const actorRef = useActorRef(projectOverviewLogic, { input: {
|
|
754
|
+
view,
|
|
755
|
+
fitViewPadding
|
|
478
756
|
} });
|
|
479
|
-
|
|
480
|
-
|
|
757
|
+
useEffect(() => {
|
|
758
|
+
actorRef.send({
|
|
481
759
|
type: "update.view",
|
|
482
|
-
view
|
|
760
|
+
view
|
|
483
761
|
});
|
|
484
|
-
}, [
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
762
|
+
}, [actorRef, view]);
|
|
763
|
+
const onNavigateToProjectRef = useSyncedRef(onNavigateToProject);
|
|
764
|
+
useEffect(() => {
|
|
765
|
+
const subs = [actorRef.on("navigate.to", ({ projectId }) => {
|
|
766
|
+
onNavigateToProjectRef.current?.(projectId);
|
|
489
767
|
})];
|
|
490
768
|
return () => {
|
|
491
|
-
|
|
769
|
+
subs.forEach((sub) => sub.unsubscribe());
|
|
492
770
|
};
|
|
493
|
-
}, [
|
|
494
|
-
|
|
771
|
+
}, [actorRef]);
|
|
772
|
+
const bounds = view.bounds;
|
|
773
|
+
const initialRef = useRef({
|
|
495
774
|
initialNodes: [],
|
|
496
775
|
initialEdges: [],
|
|
497
|
-
initialWidth:
|
|
498
|
-
initialHeight:
|
|
499
|
-
fitView:
|
|
776
|
+
initialWidth: bounds.width,
|
|
777
|
+
initialHeight: bounds.height,
|
|
778
|
+
fitView: false
|
|
500
779
|
});
|
|
501
|
-
return /* @__PURE__ */
|
|
502
|
-
value:
|
|
503
|
-
children: /* @__PURE__ */
|
|
504
|
-
...
|
|
505
|
-
children: [/* @__PURE__ */
|
|
506
|
-
id:
|
|
507
|
-
inherit:
|
|
508
|
-
children: /* @__PURE__ */
|
|
509
|
-
}), /* @__PURE__ */
|
|
780
|
+
return /* @__PURE__ */ jsx(ProjectsOverviewActorContextProvider, {
|
|
781
|
+
value: actorRef,
|
|
782
|
+
children: /* @__PURE__ */ jsxs(ReactFlowProvider, {
|
|
783
|
+
...initialRef.current,
|
|
784
|
+
children: [/* @__PURE__ */ jsx(LayoutGroup, {
|
|
785
|
+
id: actorRef.sessionId,
|
|
786
|
+
inherit: false,
|
|
787
|
+
children: /* @__PURE__ */ jsx(ProjectsOverviewXY, { ...props })
|
|
788
|
+
}), /* @__PURE__ */ jsx(ProjectsOverviewPanel, {})]
|
|
510
789
|
})
|
|
511
790
|
});
|
|
512
791
|
}
|
|
513
792
|
//#endregion
|
|
514
793
|
//#region ../diagram/src/LikeC4ProjectsOverview.tsx
|
|
515
|
-
function LikeC4ProjectsOverview({ view
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
794
|
+
function LikeC4ProjectsOverview({ view, className, onNavigateToProject, ...props }) {
|
|
795
|
+
const onChangeLikeC4Project = useChangeLikeC4Project();
|
|
796
|
+
const id = useId$1();
|
|
797
|
+
onNavigateToProject ??= onChangeLikeC4Project;
|
|
798
|
+
return /* @__PURE__ */ jsx(EnsureMantine, { children: /* @__PURE__ */ jsxs(FramerMotionConfig, { children: [/* @__PURE__ */ jsx(LikeC4Styles, { rootSelector: `#${id}` }), /* @__PURE__ */ jsx(RootContainer, {
|
|
799
|
+
id,
|
|
800
|
+
className,
|
|
801
|
+
children: /* @__PURE__ */ jsx(ProjectsOverview, {
|
|
802
|
+
view,
|
|
803
|
+
onNavigateToProject,
|
|
804
|
+
...props
|
|
524
805
|
})
|
|
525
806
|
})] }) });
|
|
526
807
|
}
|
|
527
808
|
//#endregion
|
|
528
809
|
//#region src/pages/ProjectsOverview.tsx
|
|
529
810
|
function ProjectsOverviewPage() {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
811
|
+
const $ = c(3);
|
|
812
|
+
const changeProject = useChangeLikeC4Project();
|
|
813
|
+
const projectsOverview = useLikeC4ProjectsOverview();
|
|
814
|
+
let t0;
|
|
815
|
+
if ($[0] !== changeProject || $[1] !== projectsOverview) {
|
|
816
|
+
t0 = /* @__PURE__ */ jsx(LikeC4ProjectsOverview, {
|
|
817
|
+
view: projectsOverview,
|
|
818
|
+
onNavigateToProject: changeProject
|
|
819
|
+
});
|
|
820
|
+
$[0] = changeProject;
|
|
821
|
+
$[1] = projectsOverview;
|
|
822
|
+
$[2] = t0;
|
|
823
|
+
} else t0 = $[2];
|
|
824
|
+
return t0;
|
|
535
825
|
}
|
|
536
826
|
//#endregion
|
|
537
827
|
export { ProjectsOverviewPage };
|