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
@@ -0,0 +1,264 @@
1
+ import "../../../chunks/rolldown-runtime.mjs";
2
+ import { f as IconExternalLink } from "../../../chunks/libs/@tabler/icons-react.mjs";
3
+ import { d as useRouter } from "../../../chunks/libs/@tanstack.mjs";
4
+ import { AlertLocalhost } from "./AlertLocalhost.mjs";
5
+ import { CopyButtonChild } from "./CopyButtonChild.mjs";
6
+ import { c } from "react/compiler-runtime";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { ComponentName } from "likec4:app-config";
9
+ import { ActionIcon, Box, Code, CopyButton, Group, Stack, Text } from "@mantine/core";
10
+ // src/components/view-page/share-modal/WebcomponentsPanel.tsx
11
+ function WebcomponentsPanel(t0) {
12
+ const $ = c(48);
13
+ const { diagram } = t0;
14
+ const router = useRouter();
15
+ let t1;
16
+ if ($[0] !== router.basepath) {
17
+ t1 = router.basepath.endsWith("/") ? router.basepath : `${router.basepath}/`;
18
+ $[0] = router.basepath;
19
+ $[1] = t1;
20
+ } else t1 = $[1];
21
+ const t2 = `${t1}likec4-views.js`;
22
+ let t3;
23
+ if ($[2] !== t2) {
24
+ t3 = new URL(t2, window.location.href);
25
+ $[2] = t2;
26
+ $[3] = t3;
27
+ } else t3 = $[3];
28
+ const href = t3.href;
29
+ let T0;
30
+ let htmlCode;
31
+ let jscode;
32
+ let t4;
33
+ let webcomponentPreview;
34
+ if ($[4] !== diagram.id || $[5] !== href || $[6] !== router) {
35
+ jscode = `
36
+ <script module src="${href}"><\/script>
37
+ `.trim();
38
+ const t5 = `
39
+ <${ComponentName.View}
40
+ view-id="${encodeURIComponent(diagram.id)}"
41
+ browser="true"
42
+ dynamic-variant="sequence">
43
+ </${ComponentName.View}>
44
+ `;
45
+ let t6;
46
+ if ($[12] !== t5) {
47
+ t6 = t5.trim();
48
+ $[12] = t5;
49
+ $[13] = t6;
50
+ } else t6 = $[13];
51
+ htmlCode = t6;
52
+ let t7;
53
+ if ($[14] !== diagram.id || $[15] !== router) {
54
+ t7 = router.buildLocation({
55
+ to: "/webcomponent/$/",
56
+ params: { _splat: diagram.id },
57
+ search: true
58
+ });
59
+ $[14] = diagram.id;
60
+ $[15] = router;
61
+ $[16] = t7;
62
+ } else t7 = $[16];
63
+ webcomponentPreview = t7;
64
+ T0 = Stack;
65
+ t4 = jscode.includes("http://localhost") && /* @__PURE__ */ jsx(AlertLocalhost, {});
66
+ $[4] = diagram.id;
67
+ $[5] = href;
68
+ $[6] = router;
69
+ $[7] = T0;
70
+ $[8] = htmlCode;
71
+ $[9] = jscode;
72
+ $[10] = t4;
73
+ $[11] = webcomponentPreview;
74
+ } else {
75
+ T0 = $[7];
76
+ htmlCode = $[8];
77
+ jscode = $[9];
78
+ t4 = $[10];
79
+ webcomponentPreview = $[11];
80
+ }
81
+ let t5;
82
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
83
+ t5 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, {
84
+ size: "sm",
85
+ children: "Add this script to your page:"
86
+ }) });
87
+ $[17] = t5;
88
+ } else t5 = $[17];
89
+ let t6;
90
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
91
+ t6 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, {
92
+ fw: "500",
93
+ size: "sm",
94
+ children: "JavaScript"
95
+ }) });
96
+ $[18] = t6;
97
+ } else t6 = $[18];
98
+ let t7;
99
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
100
+ t7 = /* @__PURE__ */ jsx(IconExternalLink, {});
101
+ $[19] = t7;
102
+ } else t7 = $[19];
103
+ let t8;
104
+ if ($[20] !== webcomponentPreview.publicHref) {
105
+ t8 = /* @__PURE__ */ jsx(ActionIcon, {
106
+ component: "a",
107
+ href: webcomponentPreview.publicHref,
108
+ target: "_blank",
109
+ variant: "light",
110
+ color: "gray",
111
+ children: t7
112
+ });
113
+ $[20] = webcomponentPreview.publicHref;
114
+ $[21] = t8;
115
+ } else t8 = $[21];
116
+ let t9;
117
+ if ($[22] !== jscode) {
118
+ t9 = /* @__PURE__ */ jsx(CopyButton, {
119
+ value: jscode,
120
+ timeout: 1500,
121
+ children: CopyButtonChild
122
+ });
123
+ $[22] = jscode;
124
+ $[23] = t9;
125
+ } else t9 = $[23];
126
+ let t10;
127
+ if ($[24] !== t8 || $[25] !== t9) {
128
+ t10 = /* @__PURE__ */ jsxs(Group, {
129
+ justify: "space-between",
130
+ children: [t6, /* @__PURE__ */ jsxs(Group, {
131
+ gap: "xs",
132
+ children: [t8, t9]
133
+ })]
134
+ });
135
+ $[24] = t8;
136
+ $[25] = t9;
137
+ $[26] = t10;
138
+ } else t10 = $[26];
139
+ let t11;
140
+ if ($[27] !== jscode) {
141
+ t11 = /* @__PURE__ */ jsx(Code, {
142
+ block: true,
143
+ children: jscode
144
+ });
145
+ $[27] = jscode;
146
+ $[28] = t11;
147
+ } else t11 = $[28];
148
+ let t12;
149
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
150
+ t12 = /* @__PURE__ */ jsx("br", {});
151
+ $[29] = t12;
152
+ } else t12 = $[29];
153
+ let t13;
154
+ if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
155
+ t13 = /* @__PURE__ */ jsx("code", { children: "<head>" });
156
+ $[30] = t13;
157
+ } else t13 = $[30];
158
+ let t14;
159
+ if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
160
+ t14 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text, {
161
+ size: "sm",
162
+ c: "dimmed",
163
+ children: [
164
+ "This script defines a custom element (webcomponent) that renders your diagrams.",
165
+ t12,
166
+ "Script must be inserted once in the ",
167
+ t13,
168
+ " or at the end of the ",
169
+ /* @__PURE__ */ jsx("code", { children: "<body>" }),
170
+ " ",
171
+ "tag."
172
+ ]
173
+ }) });
174
+ $[31] = t14;
175
+ } else t14 = $[31];
176
+ let t15;
177
+ if ($[32] !== t10 || $[33] !== t11) {
178
+ t15 = /* @__PURE__ */ jsxs(Stack, {
179
+ gap: "xs",
180
+ children: [
181
+ t10,
182
+ t11,
183
+ t14
184
+ ]
185
+ });
186
+ $[32] = t10;
187
+ $[33] = t11;
188
+ $[34] = t15;
189
+ } else t15 = $[34];
190
+ let t16;
191
+ if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
192
+ t16 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, {
193
+ fw: "500",
194
+ size: "sm",
195
+ children: "HTML"
196
+ }) });
197
+ $[35] = t16;
198
+ } else t16 = $[35];
199
+ let t17;
200
+ let t18;
201
+ if ($[36] !== htmlCode) {
202
+ t17 = /* @__PURE__ */ jsxs(Group, {
203
+ justify: "space-between",
204
+ children: [t16, /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(CopyButton, {
205
+ value: htmlCode,
206
+ timeout: 1500,
207
+ children: CopyButtonChild
208
+ }) })]
209
+ });
210
+ t18 = /* @__PURE__ */ jsx(Code, {
211
+ block: true,
212
+ children: htmlCode
213
+ });
214
+ $[36] = htmlCode;
215
+ $[37] = t17;
216
+ $[38] = t18;
217
+ } else {
218
+ t17 = $[37];
219
+ t18 = $[38];
220
+ }
221
+ let t19;
222
+ if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
223
+ t19 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text, {
224
+ size: "sm",
225
+ c: "dimmed",
226
+ children: [
227
+ "Insert this code to your page. Page may have multiple ",
228
+ /* @__PURE__ */ jsx("code", { children: "<likec4-view>" }),
229
+ "."
230
+ ]
231
+ }) });
232
+ $[39] = t19;
233
+ } else t19 = $[39];
234
+ let t20;
235
+ if ($[40] !== t17 || $[41] !== t18) {
236
+ t20 = /* @__PURE__ */ jsxs(Stack, {
237
+ gap: "xs",
238
+ children: [
239
+ t17,
240
+ t18,
241
+ t19
242
+ ]
243
+ });
244
+ $[40] = t17;
245
+ $[41] = t18;
246
+ $[42] = t20;
247
+ } else t20 = $[42];
248
+ let t21;
249
+ if ($[43] !== T0 || $[44] !== t15 || $[45] !== t20 || $[46] !== t4) {
250
+ t21 = /* @__PURE__ */ jsxs(T0, { children: [
251
+ t4,
252
+ t5,
253
+ t15,
254
+ t20
255
+ ] });
256
+ $[43] = T0;
257
+ $[44] = t15;
258
+ $[45] = t20;
259
+ $[46] = t4;
260
+ $[47] = t21;
261
+ } else t21 = $[47];
262
+ return t21;
263
+ }
264
+ export { WebcomponentsPanel };
@@ -0,0 +1,17 @@
1
+ import "../../chunks/rolldown-runtime.mjs";
2
+ import { t as useStore } from "../../chunks/react.mjs";
3
+ import { n as onMount, r as atom } from "../../chunks/libs/nanostores.mjs";
4
+ // src/components/view-page/state.ts
5
+ var headerVisibleAtom = /* @__PURE__ */ atom(true);
6
+ onMount(headerVisibleAtom, () => {
7
+ headerVisibleAtom.set(true);
8
+ });
9
+ var useHeaderVisible = () => {
10
+ return useStore(headerVisibleAtom);
11
+ };
12
+ var headerOps = {
13
+ toggle: (value) => headerVisibleAtom.set(value ?? !headerVisibleAtom.get()),
14
+ show: () => headerVisibleAtom.set(true),
15
+ hide: () => headerVisibleAtom.set(false)
16
+ };
17
+ export { headerOps, useHeaderVisible };
@@ -0,0 +1,26 @@
1
+ import "../chunks/rolldown-runtime.mjs";
2
+ import { c } from "react/compiler-runtime";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { CustomizationProvider } from "likec4/react";
5
+ import { useCustomComponents } from "likec4:customization";
6
+ // src/context/LikeC4CustomizationContext.tsx
7
+ /**
8
+ * Applies UI overrides from the customization file configured in the LikeC4 Vite plugin
9
+ */
10
+ function LikeC4CustomizationContext(t0) {
11
+ const $ = c(3);
12
+ const { children } = t0;
13
+ const components = useCustomComponents();
14
+ let t1;
15
+ if ($[0] !== children || $[1] !== components) {
16
+ t1 = /* @__PURE__ */ jsx(CustomizationProvider, {
17
+ components,
18
+ children
19
+ });
20
+ $[0] = children;
21
+ $[1] = components;
22
+ $[2] = t1;
23
+ } else t1 = $[2];
24
+ return t1;
25
+ }
26
+ export { LikeC4CustomizationContext };
@@ -0,0 +1,29 @@
1
+ import "../chunks/rolldown-runtime.mjs";
2
+ import { c } from "react/compiler-runtime";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { IconRendererProvider } from "likec4/react";
5
+ import { getProjectIcons } from "likec4:icons";
6
+ // src/context/LikeC4IconRendererContext.tsx
7
+ function LikeC4IconRendererContext(t0) {
8
+ const $ = c(5);
9
+ const { children, projectId } = t0;
10
+ let t1;
11
+ if ($[0] !== projectId) {
12
+ t1 = getProjectIcons(projectId);
13
+ $[0] = projectId;
14
+ $[1] = t1;
15
+ } else t1 = $[1];
16
+ const IconRenderer = t1;
17
+ let t2;
18
+ if ($[2] !== IconRenderer || $[3] !== children) {
19
+ t2 = /* @__PURE__ */ jsx(IconRendererProvider, {
20
+ value: IconRenderer,
21
+ children
22
+ });
23
+ $[2] = IconRenderer;
24
+ $[3] = children;
25
+ $[4] = t2;
26
+ } else t2 = $[4];
27
+ return t2;
28
+ }
29
+ export { LikeC4IconRendererContext };
@@ -0,0 +1,34 @@
1
+ import "../chunks/rolldown-runtime.mjs";
2
+ import { t as useStore } from "../chunks/react.mjs";
3
+ import { LikeC4ModelDataContextProvider } from "./safeCtx.mjs";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { LikeC4ModelProvider } from "likec4/react";
7
+ // src/context/LikeC4ModelContext.tsx
8
+ function LikeC4ModelContext(t0) {
9
+ const $ = c(6);
10
+ const { likec4model, children } = t0;
11
+ const model = useStore(likec4model);
12
+ let t1;
13
+ if ($[0] !== children || $[1] !== model) {
14
+ t1 = /* @__PURE__ */ jsx(LikeC4ModelProvider, {
15
+ likec4model: model,
16
+ children
17
+ });
18
+ $[0] = children;
19
+ $[1] = model;
20
+ $[2] = t1;
21
+ } else t1 = $[2];
22
+ let t2;
23
+ if ($[3] !== likec4model || $[4] !== t1) {
24
+ t2 = /* @__PURE__ */ jsx(LikeC4ModelDataContextProvider, {
25
+ value: likec4model,
26
+ children: t1
27
+ });
28
+ $[3] = likec4model;
29
+ $[4] = t1;
30
+ $[5] = t2;
31
+ } else t2 = $[5];
32
+ return t2;
33
+ }
34
+ export { LikeC4ModelContext };
@@ -0,0 +1,40 @@
1
+ import "../chunks/rolldown-runtime.mjs";
2
+ import { c as useNavigate } from "../chunks/libs/@tanstack.mjs";
3
+ import { c } from "react/compiler-runtime";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { useLikeC4Projects } from "likec4:projects";
6
+ import { LikeC4ProjectsProvider } from "likec4/react";
7
+ import { useCallbackRef } from "@mantine/hooks";
8
+ // src/context/LikeC4ProjectsContext.tsx
9
+ function LikeC4ProjectsContext(t0) {
10
+ const $ = c(6);
11
+ const { children } = t0;
12
+ const projects = useLikeC4Projects();
13
+ const navigate = useNavigate();
14
+ let t1;
15
+ if ($[0] !== navigate) {
16
+ t1 = (projectId) => {
17
+ navigate({
18
+ to: "/project/$projectId/",
19
+ params: { projectId }
20
+ }).catch(console.error);
21
+ };
22
+ $[0] = navigate;
23
+ $[1] = t1;
24
+ } else t1 = $[1];
25
+ const onProjectChange = useCallbackRef(t1);
26
+ let t2;
27
+ if ($[2] !== children || $[3] !== onProjectChange || $[4] !== projects) {
28
+ t2 = /* @__PURE__ */ jsx(LikeC4ProjectsProvider, {
29
+ projects,
30
+ onProjectChange,
31
+ children
32
+ });
33
+ $[2] = children;
34
+ $[3] = onProjectChange;
35
+ $[4] = projects;
36
+ $[5] = t2;
37
+ } else t2 = $[5];
38
+ return t2;
39
+ }
40
+ export { LikeC4ProjectsContext };
@@ -0,0 +1,33 @@
1
+ import "../chunks/rolldown-runtime.mjs";
2
+ import { t as useStore } from "../chunks/react.mjs";
3
+ import { r as atom } from "../chunks/libs/nanostores.mjs";
4
+ import { createContext, useContext } from "react";
5
+ import { c } from "react/compiler-runtime";
6
+ import { jsx } from "react/jsx-runtime";
7
+ // src/context/ModelDiffsContext.tsx
8
+ var ModelDiffsCtx = createContext(/* @__PURE__ */ atom({
9
+ diffs: [],
10
+ views: {}
11
+ }));
12
+ /**
13
+ * Provides the diffs of the project with their compare views
14
+ */
15
+ function ModelDiffsContext(t0) {
16
+ const $ = c(3);
17
+ const { diffs, children } = t0;
18
+ let t1;
19
+ if ($[0] !== children || $[1] !== diffs) {
20
+ t1 = /* @__PURE__ */ jsx(ModelDiffsCtx.Provider, {
21
+ value: diffs,
22
+ children
23
+ });
24
+ $[0] = children;
25
+ $[1] = diffs;
26
+ $[2] = t1;
27
+ } else t1 = $[2];
28
+ return t1;
29
+ }
30
+ var useModelDiffs = () => {
31
+ return useStore(useContext(ModelDiffsCtx));
32
+ };
33
+ export { ModelDiffsContext, useModelDiffs };
@@ -0,0 +1,14 @@
1
+ import "../chunks/rolldown-runtime.mjs";
2
+ import { createContext, useContext } from "react";
3
+ // src/context/safeCtx.ts
4
+ /**
5
+ * To improve experience with HMR, we move context to separate files and use as a boundary for hooks
6
+ */
7
+ var LikeC4ModelDataContext = createContext(null);
8
+ var LikeC4ModelDataContextProvider = LikeC4ModelDataContext.Provider;
9
+ var useLikeC4ModelAtom = () => {
10
+ const ctx = useContext(LikeC4ModelDataContext);
11
+ if (ctx === null) throw new Error("LikeC4ModelAtom is not provided");
12
+ return ctx;
13
+ };
14
+ export { LikeC4ModelDataContextProvider, useLikeC4ModelAtom };