likec4 1.59.4 → 1.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/README.md +2 -0
  2. package/__app__/codegen/react.mjs +4 -10
  3. package/__app__/codegen/webcomponent.mjs +6 -131
  4. package/__app__/index.html +15 -15
  5. package/__app__/src/aichat/index.mjs +11 -7
  6. package/__app__/src/chunks/AIChat.mjs +1355 -739
  7. package/__app__/src/chunks/ErrorComponent.mjs +444 -0
  8. package/__app__/src/chunks/Header.mjs +269 -0
  9. package/__app__/src/chunks/ViewReact.mjs +438 -0
  10. package/__app__/src/chunks/find.mjs +38 -0
  11. package/__app__/src/chunks/hooks.mjs +158 -472
  12. package/__app__/src/chunks/libs/@tabler/icons-react.mjs +340 -0
  13. package/__app__/src/chunks/libs/@tanstack-ai.mjs +11841 -1417
  14. package/__app__/src/chunks/libs/@tanstack.mjs +5110 -2404
  15. package/__app__/src/chunks/libs/fast-equals.mjs +507 -214
  16. package/__app__/src/chunks/libs/html-to-image.mjs +613 -0
  17. package/__app__/src/chunks/libs/nanostores.mjs +170 -0
  18. package/__app__/src/chunks/libs/react-resizable-panels.mjs +2792 -0
  19. package/__app__/src/chunks/react.mjs +22 -0
  20. package/__app__/src/chunks/rolldown-runtime.mjs +16 -29
  21. package/__app__/src/chunks/router.mjs +106 -0
  22. package/__app__/src/chunks/scope.mjs +106 -0
  23. package/__app__/src/chunks/searchParams.mjs +29 -0
  24. package/__app__/src/chunks/single-index.mjs +465 -0
  25. package/__app__/src/chunks/styled-system.mjs +1826 -2528
  26. package/__app__/src/chunks/useAsync.mjs +69 -0
  27. package/__app__/src/chunks/useSyncedRef.mjs +16 -0
  28. package/__app__/src/components/ColorSchemeToggle.mjs +124 -0
  29. package/__app__/src/components/CopyToClipboard.mjs +53 -0
  30. package/__app__/src/components/ErrorComponent.mjs +1 -0
  31. package/__app__/src/components/NavigationPanel.mjs +63 -0
  32. package/__app__/src/components/NotFound.mjs +155 -0
  33. package/__app__/src/components/ViewOutlet.mjs +9 -0
  34. package/__app__/src/components/model-diff/CompareModelProvider.mjs +44 -0
  35. package/__app__/src/components/model-diff/ModelDiffPanel.mjs +179 -0
  36. package/__app__/src/components/model-diff/compare-model.mjs +76 -0
  37. package/__app__/src/components/model-diff/state.mjs +45 -0
  38. package/__app__/src/components/search/OverviewSearch.mjs +92 -0
  39. package/__app__/src/components/search/OverviewSearchAdapter.mjs +94 -0
  40. package/__app__/src/components/sidebar/DiagramTree.css.mjs +48 -0
  41. package/__app__/src/components/sidebar/DiagramsTree.mjs +304 -0
  42. package/__app__/src/components/sidebar/Drawer.mjs +178 -0
  43. package/__app__/src/components/sidebar/SidebarBurger.mjs +28 -0
  44. package/__app__/src/components/sidebar/data.mjs +94 -0
  45. package/__app__/src/components/sidebar/state.mjs +16 -0
  46. package/__app__/src/components/view-page/Header.mjs +1 -0
  47. package/__app__/src/components/view-page/SelectProject.mjs +258 -0
  48. package/__app__/src/components/view-page/ShareModal.mjs +111 -0
  49. package/__app__/src/components/view-page/share-modal/AlertLocalhost.mjs +31 -0
  50. package/__app__/src/components/view-page/share-modal/CopyButtonChild.mjs +36 -0
  51. package/__app__/src/components/view-page/share-modal/EmbedPanel.mjs +100 -0
  52. package/__app__/src/components/view-page/share-modal/WebcomponentsPanel.mjs +264 -0
  53. package/__app__/src/components/view-page/state.mjs +17 -0
  54. package/__app__/src/context/LikeC4CustomizationContext.mjs +26 -0
  55. package/__app__/src/context/LikeC4IconRendererContext.mjs +29 -0
  56. package/__app__/src/context/LikeC4ModelContext.mjs +34 -0
  57. package/__app__/src/context/LikeC4ProjectsContext.mjs +40 -0
  58. package/__app__/src/context/ModelDiffsContext.mjs +33 -0
  59. package/__app__/src/context/safeCtx.mjs +14 -0
  60. package/__app__/src/fonts.css +112 -1
  61. package/__app__/src/hooks.mjs +1 -0
  62. package/__app__/src/main.mjs +6 -29151
  63. package/__app__/src/pages/EmbedPage.mjs +93 -0
  64. package/__app__/src/pages/ExportPage.mjs +691 -0
  65. package/__app__/src/pages/ProjectsOverview.mjs +23 -0
  66. package/__app__/src/pages/ViewAsD2.mjs +105 -0
  67. package/__app__/src/pages/ViewAsDot.mjs +65 -0
  68. package/__app__/src/pages/ViewAsMmd.mjs +109 -0
  69. package/__app__/src/pages/ViewAsPuml.mjs +105 -0
  70. package/__app__/src/pages/ViewEditor.mjs +220 -0
  71. package/__app__/src/pages/ViewReact.mjs +1 -0
  72. package/__app__/src/pages/export-layout.mjs +95 -0
  73. package/__app__/src/pages/export-page-params.mjs +9 -0
  74. package/__app__/src/pages/styles.css.mjs +23 -0
  75. package/__app__/src/routeTree.gen.mjs +105 -0
  76. package/__app__/src/router.mjs +1 -0
  77. package/__app__/src/routes/__root.mjs +65 -0
  78. package/__app__/src/routes/index.css.mjs +29 -0
  79. package/__app__/src/routes/index.mjs +32 -0
  80. package/__app__/src/routes/project._projectId/-components.mjs +100 -0
  81. package/__app__/src/routes/project._projectId/embed._viewId.mjs +5 -0
  82. package/__app__/src/routes/project._projectId/export._viewId.mjs +24 -0
  83. package/__app__/src/routes/project._projectId/index.mjs +14 -0
  84. package/__app__/src/routes/project._projectId/route.mjs +93 -0
  85. package/__app__/src/routes/project._projectId/view._viewId.d2.mjs +34 -0
  86. package/__app__/src/routes/project._projectId/view._viewId.dot.mjs +41 -0
  87. package/__app__/src/routes/project._projectId/view._viewId.index.mjs +7 -0
  88. package/__app__/src/routes/project._projectId/view._viewId.mjs +23 -0
  89. package/__app__/src/routes/project._projectId/view._viewId.mmd.mjs +39 -0
  90. package/__app__/src/routes/project._projectId/view._viewId.puml.mjs +34 -0
  91. package/__app__/src/routes/projects.mjs +36 -0
  92. package/__app__/src/routes/single-index.mjs +1 -0
  93. package/__app__/src/routes/webcomponent._.mjs +94 -0
  94. package/__app__/src/style.css +18497 -1
  95. package/config/schema.json +146 -97
  96. package/dist/app/render-view-client.css +1 -1
  97. package/dist/app/render-view-client.js +394 -238
  98. package/dist/chunks/enableServer.mjs +1 -1
  99. package/dist/chunks/filenames.mjs +25 -17
  100. package/dist/chunks/generate-likec4.mjs +5 -0
  101. package/dist/chunks/index.d.mts +255 -194
  102. package/dist/chunks/index2.d.mts +8246 -3610
  103. package/dist/chunks/libs/@chenglou/pretext.mjs +9 -0
  104. package/dist/chunks/libs/@chevrotain/gast.mjs +27 -1
  105. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +81 -9
  106. package/dist/chunks/libs/@logtape/logtape.mjs +5 -4
  107. package/dist/chunks/libs/@lume/kiwi.mjs +1 -1
  108. package/dist/chunks/libs/@ts-graphviz/common.d.mts +2 -4
  109. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
  110. package/dist/chunks/libs/birpc.mjs +1 -1
  111. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
  112. package/dist/chunks/libs/chevrotain.mjs +88 -36
  113. package/dist/chunks/libs/clone.mjs +1 -0
  114. package/dist/chunks/libs/eventemitter3.mjs +1 -1
  115. package/dist/chunks/libs/fast-equals.mjs +1 -0
  116. package/dist/chunks/libs/fontkit.mjs +1 -0
  117. package/dist/chunks/libs/json5.mjs +4 -4
  118. package/dist/chunks/libs/langium.d.mts +6707 -6715
  119. package/dist/chunks/libs/langium.mjs +16 -24
  120. package/dist/chunks/libs/merge-error-cause.mjs +1 -1
  121. package/dist/chunks/libs/p-limit.mjs +1 -0
  122. package/dist/chunks/libs/p-queue.mjs +1 -1
  123. package/dist/chunks/libs/package-manager-detector.mjs +1 -1
  124. package/dist/chunks/libs/pako.mjs +1 -1
  125. package/dist/chunks/libs/pathe.mjs +1 -1
  126. package/dist/chunks/libs/pretty-ms.mjs +1 -1
  127. package/dist/chunks/libs/remeda.mjs +1 -1
  128. package/dist/chunks/libs/ufo.mjs +1 -1
  129. package/dist/chunks/libs/unstorage.mjs +1 -1
  130. package/dist/chunks/libs/which.mjs +1 -1
  131. package/dist/chunks/node.mjs +111 -77
  132. package/dist/chunks/rolldown-runtime.mjs +1 -1
  133. package/dist/chunks/sequence-view.mjs +1 -1
  134. package/dist/chunks/vite-plugin.mjs +185 -166
  135. package/dist/cli/index.mjs +254 -1306
  136. package/dist/config/index.d.mts +66 -5
  137. package/dist/config/index.mjs +1 -1
  138. package/dist/generators/likec4.d.mts +6530 -0
  139. package/dist/generators/likec4.mjs +1 -0
  140. package/dist/index.d.mts +2 -4
  141. package/dist/model/index.d.mts +0 -7
  142. package/dist/vite-plugin/index.d.mts +83 -58
  143. package/dist/vite-plugin/index.mjs +1 -1
  144. package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +8 -0
  145. package/dist/vite-plugin/internal/index.d.mts +92 -17
  146. package/dist/vite-plugin/internal/index.mjs +225 -126
  147. package/generators/likec4/package.json +4 -0
  148. package/package.json +134 -122
  149. package/react/index.d.mts +7496 -26659
  150. package/react/index.mjs +533 -63936
  151. package/react/rolldown-runtime-CfRud99p.js +1 -0
  152. package/skills/likec4-dsl/SKILL.md +474 -0
  153. package/skills/likec4-dsl/evals/evals-public.json +207 -0
  154. package/skills/likec4-dsl/evals/grading-spec.json +603 -0
  155. package/skills/likec4-dsl/references/bridge-leanix-drawio.md +42 -0
  156. package/skills/likec4-dsl/references/cli.md +168 -0
  157. package/skills/likec4-dsl/references/configuration.md +266 -0
  158. package/skills/likec4-dsl/references/deployment.md +160 -0
  159. package/skills/likec4-dsl/references/diffs.md +52 -0
  160. package/skills/likec4-dsl/references/dynamic-views.md +455 -0
  161. package/skills/likec4-dsl/references/examples.md +370 -0
  162. package/skills/likec4-dsl/references/identifier-validity.md +90 -0
  163. package/skills/likec4-dsl/references/include-predicates-wildcards.md +180 -0
  164. package/skills/likec4-dsl/references/model.md +182 -0
  165. package/skills/likec4-dsl/references/predicates.md +123 -0
  166. package/skills/likec4-dsl/references/relationships-bidirectional.md +176 -0
  167. package/skills/likec4-dsl/references/specification.md +79 -0
  168. package/skills/likec4-dsl/references/style-tokens-colors.md +150 -0
  169. package/skills/likec4-dsl/references/troubleshooting.md +101 -0
  170. package/skills/likec4-dsl/references/views.md +329 -0
  171. package/vite-plugin-modules.d.ts +126 -51
  172. package/__app__/src/chunks/LikeC4Styles.mjs +0 -2306
  173. package/__app__/src/chunks/ProjectsOverview.mjs +0 -537
  174. package/__app__/src/chunks/es.mjs +0 -439
  175. package/__app__/src/chunks/libs/@floating-ui.mjs +0 -2532
  176. package/__app__/src/chunks/libs/@mantine.mjs +0 -13868
  177. package/__app__/src/chunks/libs/@xstate/react.mjs +0 -2015
  178. package/__app__/src/chunks/libs/@xyflow/react.mjs +0 -5367
  179. package/__app__/src/chunks/libs/bezier-js.mjs +0 -1007
  180. package/__app__/src/chunks/libs/d3.mjs +0 -2817
  181. package/__app__/src/chunks/libs/framer.mjs +0 -5926
  182. package/__app__/src/chunks/libs/zod.mjs +0 -3176
  183. package/dist/chunks/libs/@chevrotain/types.d.mts +0 -108
  184. package/dist/chunks/libs/picomatch.mjs +0 -1
  185. package/dist/chunks/libs/zod.d.mts +0 -3840
  186. package/dist/chunks/libs/zod.mjs +0 -65
@@ -1,537 +0,0 @@
1
- import "./rolldown-runtime.mjs";
2
- import { D as e, j as t } from "./hooks.mjs";
3
- import { A as n, D as r, F as i, I as a, O as o, Q as s, a as c, c as l, d as u, f as d, h as f, i as p, l as m, mt as h, n as g, nt as _, o as v, ot as y, r as b, s as x, t as S, tt as C, u as w, x as T, z as E } from "./LikeC4Styles.mjs";
4
- import { fn as ee } from "./libs/@mantine.mjs";
5
- import { I as te } from "./styled-system.mjs";
6
- import { C as ne, c as re, d as ie, g as ae, u as oe } from "./libs/@xyflow/react.mjs";
7
- import { n as D } from "./libs/fast-equals.mjs";
8
- import { _ as O, g as k, o as A, p as j, v as M, y as N } from "./libs/framer.mjs";
9
- import { a as P, i as F, l as I, n as L, r as R, t as z } from "./libs/@xstate/react.mjs";
10
- import { createContext as B, memo as V, useContext as H, useEffect as U, useRef as W } from "react";
11
- import { c as G } from "react/compiler-runtime";
12
- import { jsx as K, jsxs as q } from "react/jsx-runtime";
13
- import { invariant as se, nonNullable as J, nonexhaustive as ce } from "@likec4/core";
14
- import { useLikeC4ProjectsOverview as le } from "likec4:projects-overview";
15
- //#region ../diagram/src/projects-overview/layouted-to-xyflow.ts
16
- function layoutedProjectsViewToXYFlow(e) {
17
- return {
18
- xynodes: t(e.nodes, projectNodeToXY),
19
- xyedges: t(e.edges, projectEdgeToXY)
20
- };
21
- }
22
- function projectNodeToXY({ id: e, x: t, y: n, width: r, height: i, ...a }) {
23
- return {
24
- id: e,
25
- position: {
26
- x: t,
27
- y: n
28
- },
29
- type: "project",
30
- initialWidth: r,
31
- initialHeight: i,
32
- draggable: !1,
33
- deletable: !1,
34
- zIndex: _.Element,
35
- style: {
36
- width: r,
37
- height: i
38
- },
39
- data: {
40
- id: e,
41
- width: r,
42
- height: i,
43
- ...a
44
- }
45
- };
46
- }
47
- function projectEdgeToXY({ id: e, source: t, target: n, ...r }) {
48
- return {
49
- id: e,
50
- source: t,
51
- target: n,
52
- type: "relationship",
53
- zIndex: _.Edge,
54
- deletable: !1,
55
- data: {
56
- id: e,
57
- technology: null,
58
- labelBBox: null,
59
- ...r
60
- }
61
- };
62
- }
63
- //#endregion
64
- //#region ../diagram/src/projects-overview/persistence.ts
65
- var Y = "likec4:projects-overview:lastViewport", X = {
66
- read() {
67
- try {
68
- let e = sessionStorage.getItem(Y);
69
- return e ? JSON.parse(e) : null;
70
- } catch (e) {
71
- return console.error(`Error reading fromStorage ${Y}:`, e), null;
72
- }
73
- },
74
- write(e) {
75
- if (!e) {
76
- sessionStorage.removeItem(Y);
77
- return;
78
- }
79
- sessionStorage.setItem(Y, JSON.stringify(e));
80
- }
81
- }, Z = F({
82
- types: {
83
- context: {},
84
- tags: "",
85
- input: {},
86
- events: {},
87
- emitted: {}
88
- },
89
- guards: {
90
- isReady: ({ context: e }) => e.initialized.xydata && e.initialized.xyflow && !!e.xystore && !!e.xyflow,
91
- "click: selected node": ({ event: e }) => e.type === "xyflow.click.node" && e.node.selected === !0
92
- }
93
- }), updateView = () => Z.assign(({ event: e }) => {
94
- R(e, "update.view");
95
- let { xynodes: t, xyedges: n } = layoutedProjectsViewToXYFlow(e.view);
96
- return {
97
- view: e.view,
98
- xynodes: t,
99
- xyedges: n
100
- };
101
- }), xyflowApplyNodeChanges = () => Z.assign(({ context: e, event: t }) => (R(t, "xyflow.applyNodeChanges"), { xynodes: ie(t.changes, e.xynodes) })), xyflowApplyEdgeChanges = () => Z.assign(({ context: e, event: t }) => (R(t, "xyflow.applyEdgeChanges"), { xyedges: oe(t.changes, e.xyedges) })), onMouseEnterOrLeave = () => Z.assign(({ context: e, event: t }) => {
102
- R(t, [
103
- "xyflow.mouse.enter.edge",
104
- "xyflow.mouse.leave.edge",
105
- "xyflow.mouse.enter.node",
106
- "xyflow.mouse.leave.node"
107
- ]);
108
- let n = t.type.startsWith("xyflow.mouse.enter");
109
- switch (t.type) {
110
- case "xyflow.mouse.enter.edge":
111
- case "xyflow.mouse.leave.edge": {
112
- let r = t.edge.id;
113
- return { xyedges: e.xyedges.map((e) => e.id === r ? a.setHovered(e, n) : e) };
114
- }
115
- case "xyflow.mouse.enter.node":
116
- case "xyflow.mouse.leave.node": {
117
- let r = t.node.id;
118
- return { xynodes: e.xynodes.map((e) => e.id === r ? a.setHovered(e, n) : e) };
119
- }
120
- default: ce(t);
121
- }
122
- }), saveViewport = () => Z.createAction(({ context: e }) => {
123
- let t = e.xyflow;
124
- t && X.write(t.getViewport());
125
- }), handleClick = () => Z.enqueueActions(({ event: e, enqueue: t }) => {
126
- if (e.type === "xyflow.click.double") {
127
- t(fitDiagram());
128
- return;
129
- }
130
- }), fitDiagram = (e) => Z.enqueueActions(({ context: t, event: n }) => {
131
- let r = t.view.bounds, i;
132
- e ? (r = e.bounds ?? t.view.bounds, i = e.duration) : n.type === "xyflow.fitDiagram" && (r = n.bounds ?? t.view.bounds, i = n.duration), i ??= 450;
133
- let { width: a, height: o, panZoom: s, transform: c } = J(t.xystore).getState(), l = Math.max(1, c[2]), u = ne(r, a, o, C, l, t.fitViewPadding);
134
- u.x = Math.round(u.x), u.y = Math.round(u.y);
135
- let d = i > 0 ? {
136
- duration: i,
137
- interpolate: "smooth"
138
- } : void 0;
139
- s?.setViewport(u, d).catch((e) => {
140
- console.error("Error during fitDiagram panZoom setViewport", { err: e });
141
- }), X.write(null);
142
- }), restoreViewport = () => Z.enqueueActions(({ context: e, enqueue: t }) => {
143
- let n = X.read();
144
- if (n) {
145
- J(e.xyflow).setViewport(n, { duration: 0 });
146
- return;
147
- }
148
- t(fitDiagram({ duration: 0 }));
149
- }), dispose = () => Z.assign({
150
- xyflow: null,
151
- xystore: null,
152
- initialized: {
153
- xyflow: !1,
154
- xydata: !1
155
- },
156
- xyedges: [],
157
- xynodes: []
158
- }), assignNavigateTo = () => Z.assign(({ event: e, context: t }) => {
159
- let n;
160
- switch (e.type) {
161
- case "xyflow.click.node":
162
- n = e.node;
163
- break;
164
- case "navigate.to":
165
- n = J(t.xynodes.find((t) => t.id === e.fromNode), `Node ${e.fromNode} not found`);
166
- break;
167
- default: return console.warn(`Unexpected event ${e.type} in assignNavigateTo`), {};
168
- }
169
- return { navigateTo: n };
170
- }), ue = Z.createMachine({
171
- id: "projects-overview",
172
- context: ({ input: e }) => ({
173
- ...e,
174
- initialized: {
175
- xydata: !1,
176
- xyflow: !1
177
- },
178
- xyflow: null,
179
- xystore: null,
180
- xynodes: [],
181
- xyedges: []
182
- }),
183
- initial: "init",
184
- on: { close: { target: ".closed" } },
185
- states: {
186
- init: { on: {
187
- "update.view": {
188
- actions: [updateView(), I(({ context: e }) => ({ initialized: {
189
- ...e.initialized,
190
- xydata: !0
191
- } }))],
192
- target: "isReady"
193
- },
194
- "xyflow.init": {
195
- actions: [I(({ context: e, event: t }) => ({
196
- initialized: {
197
- ...e.initialized,
198
- xyflow: !0
199
- },
200
- xyflow: t.xyflow,
201
- xystore: t.xystore
202
- }))],
203
- target: "isReady"
204
- }
205
- } },
206
- isReady: { always: [{
207
- guard: "isReady",
208
- target: "active"
209
- }, { target: "init" }] },
210
- active: {
211
- tags: "active",
212
- entry: [restoreViewport()],
213
- on: {
214
- "navigate.to": {
215
- actions: assignNavigateTo(),
216
- target: "navigate"
217
- },
218
- "xyflow.applyNodeChanges": { actions: xyflowApplyNodeChanges() },
219
- "xyflow.applyEdgeChanges": { actions: xyflowApplyEdgeChanges() },
220
- "xyflow.mouse.*": { actions: onMouseEnterOrLeave() },
221
- "xyflow.click.*": [{
222
- guard: "click: selected node",
223
- actions: assignNavigateTo(),
224
- target: "navigate"
225
- }, { actions: handleClick() }],
226
- "xyflow.fitDiagram": { actions: fitDiagram() },
227
- "update.view": { actions: updateView() }
228
- }
229
- },
230
- navigate: {
231
- tags: "active",
232
- entry: [
233
- saveViewport(),
234
- I({ xyedges: [] }),
235
- ({ context: { navigateTo: e, xyflow: t, xystore: n }, self: r }) => {
236
- se(t && e, "Invalid state, xyflow is undefined");
237
- let { width: i, domNode: a } = J(n).getState(), o = h(Math.min(i * 7 / 9 / e.data.width), {
238
- min: C,
239
- max: 2.5
240
- }), s = {
241
- x: Math.round(-o * e.position.x + (i - o * e.data.width) / 2),
242
- y: Math.round(-o * e.position.y) + 50
243
- }, c = t.getViewport(), l = a.querySelectorAll(`.react-flow__node-project:not([data-id="${e.id}"]) > *`), u = A(l, {
244
- opacity: 0,
245
- scale: .9
246
- }, {
247
- visualDuration: .25,
248
- delay: O(.08, { from: "center" })
249
- }), d = N(1), f = k(d, [1, 0], [`translate(${c.x}px, ${c.y}px) scale(${c.zoom})`, `translate(${s.x}px, ${s.y}px) scale(${o})`]), p = M(a.querySelector(".xyflow__viewport"), { transform: f }), m = M(a.querySelector(`.react-flow__node-project:is([data-id="${e.id}"]) > *`), { opacity: d }), g = A(d, 0, {
250
- delay: l.length > 3 ? .25 : 0,
251
- type: "spring",
252
- stiffness: 350,
253
- damping: 40,
254
- mass: 1.5,
255
- visualDuration: .55
256
- });
257
- Promise.race([g.finished, sleep(750)]).then(() => {
258
- p(), m(), g.stop(), u.stop(), r.send({
259
- type: "emit.navigate.to",
260
- projectId: e.data.projectId
261
- });
262
- });
263
- }
264
- ],
265
- on: { "emit.navigate.to": { actions: P(({ event: e }) => ({
266
- ...e,
267
- type: "navigate.to"
268
- })) } }
269
- },
270
- closed: {
271
- id: "closed",
272
- type: "final",
273
- entry: dispose()
274
- }
275
- }
276
- });
277
- function sleep(e) {
278
- return new Promise((t) => setTimeout(t, e));
279
- }
280
- //#endregion
281
- //#region ../diagram/src/projects-overview/context.ts
282
- var Q = B(null), de = Q.Provider;
283
- function useProjectsOverviewActor() {
284
- let e = G(2), t = H(Q), n;
285
- return e[0] === t ? n = e[1] : (n = J(t, "No ProjectsOverviewActorContext"), e[0] = t, e[1] = n), n;
286
- }
287
- //#endregion
288
- //#region ../diagram/src/projects-overview/panel/ProjectsOverviewPanel.tsx
289
- var ProjectsOverviewPanel = () => {
290
- let e = G(1), t;
291
- return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ K(g.Root, { children: /* @__PURE__ */ q(g.Body, { children: [/* @__PURE__ */ K(g.Logo, {}), /* @__PURE__ */ K(g.Label, { children: "Projects Overview" })] }) }), e[0] = t) : t = e[0], t;
292
- }, fe = p((e) => {
293
- let t = E(e.data.points);
294
- return /* @__PURE__ */ q(d, {
295
- ...e,
296
- children: [/* @__PURE__ */ K(m, {
297
- edgeProps: e,
298
- svgPath: t
299
- }), /* @__PURE__ */ K(w, {
300
- edgeProps: e,
301
- children: /* @__PURE__ */ K(u, { edgeProps: e })
302
- })]
303
- });
304
- });
305
- //#endregion
306
- //#region ../diagram/src/projects-overview/custom/nodeTypes.tsx
307
- function ProjectNode(e) {
308
- let t = G(19), n = useProjectsOverviewActor(), t0;
309
- t[0] !== n || t[1] !== e.data.id || t[2] !== e.data.projectId ? (t0 = (t) => {
310
- t.stopPropagation(), n.send({
311
- type: "navigate.to",
312
- fromNode: e.data.id,
313
- projectId: e.data.projectId
314
- });
315
- }, t[0] = n, t[1] = e.data.id, t[2] = e.data.projectId, t[3] = t0) : t0 = t[3];
316
- let r = ee(t0), i, a;
317
- t[4] === e ? (i = t[5], a = t[6]) : (i = /* @__PURE__ */ K(c, { ...e }), a = /* @__PURE__ */ K(x, { ...e }), t[4] = e, t[5] = i, t[6] = a);
318
- let o;
319
- t[7] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ K(y, {}), t[7] = o) : o = t[7];
320
- let s;
321
- t[8] === r ? s = t[9] : (s = [{
322
- key: "navigate",
323
- icon: o,
324
- onClick: r
325
- }], t[8] = r, t[9] = s);
326
- let u;
327
- t[10] !== e || t[11] !== s ? (u = /* @__PURE__ */ K(l, {
328
- ...e,
329
- buttons: s
330
- }), t[10] = e, t[11] = s, t[12] = u) : u = t[12];
331
- let d;
332
- t[13] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ K(b, {}), t[13] = d) : d = t[13];
333
- let f;
334
- return t[14] !== e || t[15] !== i || t[16] !== a || t[17] !== u ? (f = /* @__PURE__ */ q(v, {
335
- layout: !0,
336
- nodeProps: e,
337
- children: [
338
- i,
339
- a,
340
- u,
341
- d
342
- ]
343
- }, e.id), t[14] = e, t[15] = i, t[16] = a, t[17] = u, t[18] = f) : f = t[18], f;
344
- }
345
- //#endregion
346
- //#region ../diagram/src/projects-overview/hooks.ts
347
- function useProjectsOverviewState(e, t) {
348
- let n = t === void 0 ? D : t, r = useProjectsOverviewActor();
349
- return L(r, e, n);
350
- }
351
- function useProjectsOverviewXYStoreApi() {
352
- return ae();
353
- }
354
- //#endregion
355
- //#region ../diagram/src/projects-overview/ProjectsOverviewXY.tsx
356
- var pe = { project: ProjectNode }, me = { relationship: fe }, selector = (e) => ({
357
- isActive: e.hasTag("active"),
358
- nodes: e.context.xynodes,
359
- edges: e.context.xyedges
360
- }), selectorEq = (e, t) => e.isActive === t.isActive && D(e.nodes, t.nodes) && D(e.edges, t.edges), $ = V((e) => {
361
- let t = G(45), n, r;
362
- t[0] === e ? (n = t[1], r = t[2]) : ({background: r, ...n} = e, t[0] = e, t[1] = n, t[2] = r);
363
- let a = r === void 0 ? "dots" : r, o = useProjectsOverviewActor(), { isActive: c, nodes: l, edges: u } = useProjectsOverviewState(selector, selectorEq), d = useProjectsOverviewXYStoreApi(), f = c ? "initialized" : "not-initialized", p;
364
- t[3] === f ? p = t[4] : (p = te(f, "projects-overview"), t[3] = f, t[4] = p);
365
- let t4;
366
- t[5] === o ? t4 = t[6] : (t4 = (e, t) => {
367
- e.stopPropagation(), o.send({
368
- type: "xyflow.click.node",
369
- node: t
370
- });
371
- }, t[5] = o, t[6] = t4);
372
- let m = s(t4), t6;
373
- t[7] === o ? t6 = t[8] : (t6 = (e, t) => {
374
- e.stopPropagation(), o.send({
375
- type: "xyflow.click.edge",
376
- edge: t
377
- });
378
- }, t[7] = o, t[8] = t6);
379
- let h = s(t6), t8;
380
- t[9] === o ? t8 = t[10] : (t8 = (e) => {
381
- e.stopPropagation(), o.send({ type: "xyflow.click.pane" });
382
- }, t[9] = o, t[10] = t8);
383
- let g = s(t8), t10;
384
- t[11] === o ? t10 = t[12] : (t10 = (e) => {
385
- e.stopPropagation(), o.send({ type: "xyflow.click.double" });
386
- }, t[11] = o, t[12] = t10);
387
- let _ = s(t10), t12;
388
- t[13] === o ? t12 = t[14] : (t12 = (e) => {
389
- o.send({
390
- type: "xyflow.applyNodeChanges",
391
- changes: e
392
- });
393
- }, t[13] = o, t[14] = t12);
394
- let v = s(t12), t14;
395
- t[15] === o ? t14 = t[16] : (t14 = (e) => {
396
- o.send({
397
- type: "xyflow.applyEdgeChanges",
398
- changes: e
399
- });
400
- }, t[15] = o, t[16] = t14);
401
- let y = s(t14), t16;
402
- t[17] === o ? t16 = t[18] : (t16 = (e, t) => {
403
- o.send({
404
- type: "xyflow.mouse.enter.edge",
405
- edge: t,
406
- event: e
407
- });
408
- }, t[17] = o, t[18] = t16);
409
- let b = s(t16), t18;
410
- t[19] === o ? t18 = t[20] : (t18 = (e, t) => {
411
- o.send({
412
- type: "xyflow.mouse.leave.edge",
413
- edge: t,
414
- event: e
415
- });
416
- }, t[19] = o, t[20] = t18);
417
- let x = s(t18), t20;
418
- t[21] === o ? t20 = t[22] : (t20 = (e, t) => {
419
- o.send({
420
- type: "xyflow.mouse.enter.node",
421
- node: t
422
- });
423
- }, t[21] = o, t[22] = t20);
424
- let S = s(t20), t22;
425
- t[23] === o ? t22 = t[24] : (t22 = (e, t) => {
426
- o.send({
427
- type: "xyflow.mouse.leave.node",
428
- node: t
429
- });
430
- }, t[23] = o, t[24] = t22);
431
- let C = s(t22), t24;
432
- t[25] !== o || t[26] !== d ? (t24 = (e) => {
433
- o.send({
434
- type: "xyflow.init",
435
- xyflow: e,
436
- xystore: d
437
- });
438
- }, t[25] = o, t[26] = d, t[27] = t24) : t24 = t[27];
439
- let w = s(t24), T;
440
- return t[28] !== a || t[29] !== u || t[30] !== l || t[31] !== n || t[32] !== _ || t[33] !== v || t[34] !== y || t[35] !== b || t[36] !== x || t[37] !== S || t[38] !== C || t[39] !== w || t[40] !== p || t[41] !== m || t[42] !== h || t[43] !== g ? (T = /* @__PURE__ */ K(i, {
441
- nodes: l,
442
- edges: u,
443
- className: p,
444
- nodeTypes: pe,
445
- edgeTypes: me,
446
- fitView: !1,
447
- onNodeClick: m,
448
- onEdgeClick: h,
449
- onPaneClick: g,
450
- onDoubleClick: _,
451
- onNodesChange: v,
452
- onEdgesChange: y,
453
- onEdgeMouseEnter: b,
454
- onEdgeMouseLeave: x,
455
- onNodeMouseEnter: S,
456
- onNodeMouseLeave: C,
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] = u, t[30] = l, t[31] = n, t[32] = _, t[33] = v, t[34] = y, t[35] = b, t[36] = x, t[37] = S, t[38] = C, t[39] = w, t[40] = p, t[41] = m, t[42] = h, t[43] = g, t[44] = T) : T = t[44], T;
465
- });
466
- $.displayName = "ProjectsOverviewXY";
467
- //#endregion
468
- //#region ../diagram/src/projects-overview/ProjectsOverview.tsx
469
- function ProjectsOverview({ view: t, onNavigateToProject: n, fitViewPadding: r = {
470
- top: "50px",
471
- bottom: "32px",
472
- left: "32px",
473
- right: "32px"
474
- }, ...i }) {
475
- let a = z(ue, { input: {
476
- view: t,
477
- fitViewPadding: r
478
- } });
479
- U(() => {
480
- a.send({
481
- type: "update.view",
482
- view: t
483
- });
484
- }, [a, t]);
485
- let o = e(n);
486
- U(() => {
487
- let e = [a.on("navigate.to", ({ projectId: e }) => {
488
- o.current?.(e);
489
- })];
490
- return () => {
491
- e.forEach((e) => e.unsubscribe());
492
- };
493
- }, [a]);
494
- let s = t.bounds, c = W({
495
- initialNodes: [],
496
- initialEdges: [],
497
- initialWidth: s.width,
498
- initialHeight: s.height,
499
- fitView: !1
500
- });
501
- return /* @__PURE__ */ K(de, {
502
- value: a,
503
- children: /* @__PURE__ */ q(re, {
504
- ...c.current,
505
- children: [/* @__PURE__ */ K(j, {
506
- id: a.sessionId,
507
- inherit: !1,
508
- children: /* @__PURE__ */ K($, { ...i })
509
- }), /* @__PURE__ */ K(ProjectsOverviewPanel, {})]
510
- })
511
- });
512
- }
513
- //#endregion
514
- //#region ../diagram/src/LikeC4ProjectsOverview.tsx
515
- function LikeC4ProjectsOverview({ view: e, className: t, onNavigateToProject: i, ...a }) {
516
- let s = f(), c = T();
517
- return i ??= s, /* @__PURE__ */ K(o, { children: /* @__PURE__ */ q(r, { children: [/* @__PURE__ */ K(S, { rootSelector: `#${c}` }), /* @__PURE__ */ K(n, {
518
- id: c,
519
- className: t,
520
- children: /* @__PURE__ */ K(ProjectsOverview, {
521
- view: e,
522
- onNavigateToProject: i,
523
- ...a
524
- })
525
- })] }) });
526
- }
527
- //#endregion
528
- //#region src/pages/ProjectsOverview.tsx
529
- function ProjectsOverviewPage() {
530
- let e = G(3), t = f(), n = le(), r;
531
- return e[0] !== t || e[1] !== n ? (r = /* @__PURE__ */ K(LikeC4ProjectsOverview, {
532
- view: n,
533
- onNavigateToProject: t
534
- }), e[0] = t, e[1] = n, e[2] = r) : r = e[2], r;
535
- }
536
- //#endregion
537
- export { ProjectsOverviewPage };