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,69 @@
1
+ import "./rolldown-runtime.mjs";
2
+ import { t as useSyncedRef } from "./useSyncedRef.mjs";
3
+ import { useMemo, useRef, useState } from "react";
4
+ // ../../node_modules/.pnpm/@react-hookz+web@26.1.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@react-hookz/web/dist/useAsync/index.js
5
+ /**
6
+ * Tracks the result and errors of the provided async function and provides handles to control its execution.
7
+ *
8
+ * @param asyncFn Function that returns a promise.
9
+ * @param initialValue Value that will be set on initialisation before the async function is
10
+ * executed.
11
+ */
12
+ function useAsync(asyncFn, initialValue) {
13
+ const [state, setState] = useState({
14
+ status: "not-executed",
15
+ error: void 0,
16
+ result: initialValue
17
+ });
18
+ const promiseRef = useRef(void 0);
19
+ const argsRef = useRef(void 0);
20
+ const methods = useSyncedRef({
21
+ async execute(...params) {
22
+ argsRef.current = params;
23
+ const promise = asyncFn(...params);
24
+ promiseRef.current = promise;
25
+ setState((s) => ({
26
+ ...s,
27
+ status: "loading"
28
+ }));
29
+ promise.then((result) => {
30
+ if (promise === promiseRef.current) setState((s) => ({
31
+ ...s,
32
+ status: "success",
33
+ error: void 0,
34
+ result
35
+ }));
36
+ }, (error) => {
37
+ if (promise === promiseRef.current) setState((previousState) => ({
38
+ ...previousState,
39
+ status: "error",
40
+ error
41
+ }));
42
+ });
43
+ return promise;
44
+ },
45
+ reset() {
46
+ setState({
47
+ status: "not-executed",
48
+ error: void 0,
49
+ result: initialValue
50
+ });
51
+ promiseRef.current = void 0;
52
+ argsRef.current = void 0;
53
+ }
54
+ });
55
+ return [
56
+ state,
57
+ useMemo(() => ({
58
+ reset() {
59
+ methods.current.reset();
60
+ },
61
+ execute: async (...params) => methods.current.execute(...params)
62
+ }), []),
63
+ {
64
+ promise: promiseRef.current,
65
+ lastArgs: argsRef.current
66
+ }
67
+ ];
68
+ }
69
+ export { useAsync as t };
@@ -0,0 +1,16 @@
1
+ import "./rolldown-runtime.mjs";
2
+ import { useMemo, useRef } from "react";
3
+ // ../../node_modules/.pnpm/@react-hookz+web@26.1.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@react-hookz/web/dist/useSyncedRef/index.js
4
+ /**
5
+ * Like `useRef`, but it returns immutable ref that contains actual value.
6
+ *
7
+ * @param value
8
+ */
9
+ function useSyncedRef(value) {
10
+ const ref = useRef(value);
11
+ ref.current = value;
12
+ return useMemo(() => Object.freeze({ get current() {
13
+ return ref.current;
14
+ } }), []);
15
+ }
16
+ export { useSyncedRef as t };
@@ -0,0 +1,124 @@
1
+ import "../chunks/rolldown-runtime.mjs";
2
+ import { c as IconMoonStars, i as IconSun } from "../chunks/libs/@tabler/icons-react.mjs";
3
+ import { c as useNavigate, l as useSearch } from "../chunks/libs/@tanstack.mjs";
4
+ import { t as resolveForceColorScheme } from "../chunks/searchParams.mjs";
5
+ import { useEffect, useRef } from "react";
6
+ import { c } from "react/compiler-runtime";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { ActionIcon, useComputedColorScheme, useMantineColorScheme } from "@mantine/core";
9
+ // src/components/ColorSchemeToggle.tsx
10
+ function ColorSchemeToggle() {
11
+ const $ = c(23);
12
+ let t0;
13
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
14
+ t0 = { keepTransitions: true };
15
+ $[0] = t0;
16
+ } else t0 = $[0];
17
+ const { setColorScheme } = useMantineColorScheme(t0);
18
+ const computedColorScheme = useComputedColorScheme("light");
19
+ const navigate = useNavigate();
20
+ let t1;
21
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
22
+ t1 = { from: "__root__" };
23
+ $[1] = t1;
24
+ } else t1 = $[1];
25
+ const { theme: urlTheme } = useSearch(t1);
26
+ let t2;
27
+ if ($[2] !== urlTheme) {
28
+ t2 = resolveForceColorScheme(urlTheme);
29
+ $[2] = urlTheme;
30
+ $[3] = t2;
31
+ } else t2 = $[3];
32
+ const isForced = t2 != null;
33
+ const pendingScheme = useRef(null);
34
+ let t3;
35
+ let t4;
36
+ if ($[4] !== isForced || $[5] !== setColorScheme) {
37
+ t3 = () => {
38
+ if (pendingScheme.current != null && !isForced) {
39
+ setColorScheme(pendingScheme.current);
40
+ pendingScheme.current = null;
41
+ }
42
+ };
43
+ t4 = [isForced, setColorScheme];
44
+ $[4] = isForced;
45
+ $[5] = setColorScheme;
46
+ $[6] = t3;
47
+ $[7] = t4;
48
+ } else {
49
+ t3 = $[6];
50
+ t4 = $[7];
51
+ }
52
+ useEffect(t3, t4);
53
+ let t5;
54
+ if ($[8] !== computedColorScheme || $[9] !== isForced || $[10] !== navigate || $[11] !== setColorScheme) {
55
+ t5 = () => {
56
+ if (pendingScheme.current != null) return;
57
+ const next = computedColorScheme === "light" ? "dark" : "light";
58
+ if (isForced) {
59
+ pendingScheme.current = next;
60
+ navigate({
61
+ to: "../",
62
+ search: _temp,
63
+ replace: true
64
+ }).catch(() => {
65
+ pendingScheme.current = null;
66
+ });
67
+ } else setColorScheme(next);
68
+ };
69
+ $[8] = computedColorScheme;
70
+ $[9] = isForced;
71
+ $[10] = navigate;
72
+ $[11] = setColorScheme;
73
+ $[12] = t5;
74
+ } else t5 = $[12];
75
+ const toggle = t5;
76
+ let t6;
77
+ if ($[13] !== computedColorScheme) {
78
+ t6 = computedColorScheme === "dark" ? ["block", "none"] : ["none", "block"];
79
+ $[13] = computedColorScheme;
80
+ $[14] = t6;
81
+ } else t6 = $[14];
82
+ const [sun, moon] = t6;
83
+ let t7;
84
+ if ($[15] !== sun) {
85
+ t7 = /* @__PURE__ */ jsx(IconSun, {
86
+ stroke: 1.5,
87
+ style: { display: sun }
88
+ });
89
+ $[15] = sun;
90
+ $[16] = t7;
91
+ } else t7 = $[16];
92
+ let t8;
93
+ if ($[17] !== moon) {
94
+ t8 = /* @__PURE__ */ jsx(IconMoonStars, {
95
+ stroke: 1.5,
96
+ style: { display: moon }
97
+ });
98
+ $[17] = moon;
99
+ $[18] = t8;
100
+ } else t8 = $[18];
101
+ let t9;
102
+ if ($[19] !== t7 || $[20] !== t8 || $[21] !== toggle) {
103
+ t9 = /* @__PURE__ */ jsxs(ActionIcon, {
104
+ size: "md",
105
+ variant: "subtle",
106
+ color: "gray",
107
+ onClick: toggle,
108
+ "aria-label": "Toggle color scheme",
109
+ children: [t7, t8]
110
+ });
111
+ $[19] = t7;
112
+ $[20] = t8;
113
+ $[21] = toggle;
114
+ $[22] = t9;
115
+ } else t9 = $[22];
116
+ return t9;
117
+ }
118
+ function _temp(prev) {
119
+ return {
120
+ ...prev,
121
+ theme: void 0
122
+ };
123
+ }
124
+ export { ColorSchemeToggle };
@@ -0,0 +1,53 @@
1
+ import "../chunks/rolldown-runtime.mjs";
2
+ import { h as IconCheck, p as IconCopy } from "../chunks/libs/@tabler/icons-react.mjs";
3
+ import { c } from "react/compiler-runtime";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { ActionIcon, Box, CopyButton as CopyButton$1, Tooltip, rem } from "@mantine/core";
6
+ // src/components/CopyToClipboard.tsx
7
+ function CopyButton(t0) {
8
+ const $ = c(2);
9
+ const { text } = t0;
10
+ let t1;
11
+ if ($[0] !== text) {
12
+ t1 = /* @__PURE__ */ jsx(CopyButton$1, {
13
+ value: text,
14
+ timeout: 2e3,
15
+ children: _temp
16
+ });
17
+ $[0] = text;
18
+ $[1] = t1;
19
+ } else t1 = $[1];
20
+ return t1;
21
+ }
22
+ function _temp(t0) {
23
+ const { copied, copy } = t0;
24
+ return /* @__PURE__ */ jsx(Tooltip, {
25
+ label: copied ? "Copied" : "Copy",
26
+ withArrow: true,
27
+ position: "right",
28
+ children: /* @__PURE__ */ jsx(ActionIcon, {
29
+ color: copied ? "teal" : "gray",
30
+ variant: copied ? "light" : "subtle",
31
+ onClick: copy,
32
+ children: copied ? /* @__PURE__ */ jsx(IconCheck, { style: { width: rem(16) } }) : /* @__PURE__ */ jsx(IconCopy, { style: { width: rem(16) } })
33
+ })
34
+ });
35
+ }
36
+ function CopyToClipboard(t0) {
37
+ const $ = c(2);
38
+ const { text } = t0;
39
+ let t1;
40
+ if ($[0] !== text) {
41
+ t1 = /* @__PURE__ */ jsx(Box, {
42
+ pos: "absolute",
43
+ top: "0",
44
+ right: "0",
45
+ p: "4",
46
+ children: /* @__PURE__ */ jsx(CopyButton, { text })
47
+ });
48
+ $[0] = text;
49
+ $[1] = t1;
50
+ } else t1 = $[1];
51
+ return t1;
52
+ }
53
+ export { CopyButton, CopyToClipboard };
@@ -0,0 +1 @@
1
+ export { t as ErrorBoundary, n as ErrorComponent, r as Fallback } from "../chunks/ErrorComponent.mjs";
@@ -0,0 +1,63 @@
1
+ import "../chunks/rolldown-runtime.mjs";
2
+ import { c as createStyleContext, d as cx, n as navigationPanel, u as isCssProperty } from "../chunks/styled-system.mjs";
3
+ import { forwardRef } from "react";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Logo, LogoIcon } from "likec4/react";
7
+ import { isValidMotionProp, m } from "motion/react";
8
+ // src/components/NavigationPanel.tsx
9
+ var { withProvider, withContext } = createStyleContext(navigationPanel);
10
+ var shouldForwardProp = (prop, variantKeys) => !variantKeys.includes(prop) && (isValidMotionProp(prop) || !isCssProperty(prop));
11
+ var LogoButton = forwardRef((t0, ref) => {
12
+ const $ = c(11);
13
+ let className;
14
+ let props;
15
+ if ($[0] !== t0) {
16
+ ({className, ...props} = t0);
17
+ $[0] = t0;
18
+ $[1] = className;
19
+ $[2] = props;
20
+ } else {
21
+ className = $[1];
22
+ props = $[2];
23
+ }
24
+ let t1;
25
+ if ($[3] !== className) {
26
+ t1 = cx("mantine-active", className);
27
+ $[3] = className;
28
+ $[4] = t1;
29
+ } else t1 = $[4];
30
+ let t2;
31
+ let t3;
32
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
33
+ t2 = /* @__PURE__ */ jsx(LogoIcon, { "data-logo-icon": true });
34
+ t3 = /* @__PURE__ */ jsx(Logo, { "data-logo-full": true });
35
+ $[5] = t2;
36
+ $[6] = t3;
37
+ } else {
38
+ t2 = $[5];
39
+ t3 = $[6];
40
+ }
41
+ let t4;
42
+ if ($[7] !== props || $[8] !== ref || $[9] !== t1) {
43
+ t4 = /* @__PURE__ */ jsxs("button", {
44
+ ...props,
45
+ ref,
46
+ className: t1,
47
+ children: [t2, t3]
48
+ });
49
+ $[7] = props;
50
+ $[8] = ref;
51
+ $[9] = t1;
52
+ $[10] = t4;
53
+ } else t4 = $[10];
54
+ return t4;
55
+ });
56
+ var NavigationPanel = {
57
+ Root: withProvider(m.div, "root", { shouldForwardProp }),
58
+ Body: withContext(m.div, "body", { shouldForwardProp }),
59
+ Logo: withContext(LogoButton, "logo", { shouldForwardProp }),
60
+ Label: withContext(m.div, "label", { shouldForwardProp }),
61
+ Dropdown: withContext(m.div, "dropdown", { shouldForwardProp })
62
+ };
63
+ export { NavigationPanel };
@@ -0,0 +1,155 @@
1
+ import "../chunks/rolldown-runtime.mjs";
2
+ import { s as Link, u as useParams } from "../chunks/libs/@tanstack.mjs";
3
+ import { f as css } from "../chunks/styled-system.mjs";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Alert, Button, Code, Container, Group, Text, Title } from "@mantine/core";
7
+ // src/components/NotFound.tsx
8
+ var classes = {
9
+ content: css({
10
+ paddingTop: "[120px]",
11
+ position: "relative",
12
+ zIndex: "[1]",
13
+ sm: { paddingTop: "[220px]" }
14
+ }),
15
+ image: css({
16
+ position: "absolute",
17
+ inset: "0",
18
+ opacity: "0.2"
19
+ }),
20
+ inner: css({ position: "relative" }),
21
+ root: css({
22
+ paddingTop: "[80px]",
23
+ paddingBottom: "[80px]"
24
+ }),
25
+ description: css({
26
+ maxWidth: "[540px]",
27
+ margin: "auto",
28
+ marginTop: "xl",
29
+ marginBottom: "[calc({spacing.xl}*1.5)]"
30
+ }),
31
+ title: css({
32
+ textAlign: "center",
33
+ fontWeight: "[900]",
34
+ fontSize: `[38px]`
35
+ })
36
+ };
37
+ function NotFound() {
38
+ const $ = c(10);
39
+ let t0;
40
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
41
+ t0 = { strict: false };
42
+ $[0] = t0;
43
+ } else t0 = $[0];
44
+ const params = useParams(t0);
45
+ if (params.viewId) {
46
+ let t1;
47
+ if ($[1] !== params.viewId) {
48
+ t1 = /* @__PURE__ */ jsxs(Text, {
49
+ c: "orange",
50
+ fz: "md",
51
+ children: [
52
+ "The diagram",
53
+ " ",
54
+ /* @__PURE__ */ jsx(Code, {
55
+ color: "orange",
56
+ children: params.viewId
57
+ }),
58
+ " ",
59
+ "does not exist or contains errors"
60
+ ]
61
+ });
62
+ $[1] = params.viewId;
63
+ $[2] = t1;
64
+ } else t1 = $[2];
65
+ let t2;
66
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
67
+ t2 = /* @__PURE__ */ jsx(Button, {
68
+ component: Link,
69
+ to: "/",
70
+ variant: "light",
71
+ color: "orange",
72
+ mt: "lg",
73
+ size: "xs",
74
+ children: "Go to overview"
75
+ });
76
+ $[3] = t2;
77
+ } else t2 = $[3];
78
+ let t3;
79
+ if ($[4] !== t1) {
80
+ t3 = /* @__PURE__ */ jsx(Container, {
81
+ my: "md",
82
+ children: /* @__PURE__ */ jsxs(Alert, {
83
+ variant: "light",
84
+ color: "orange",
85
+ children: [t1, t2]
86
+ })
87
+ });
88
+ $[4] = t1;
89
+ $[5] = t3;
90
+ } else t3 = $[5];
91
+ return t3;
92
+ }
93
+ let t1;
94
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
95
+ t1 = /* @__PURE__ */ jsx("svg", {
96
+ xmlns: "http://www.w3.org/2000/svg",
97
+ viewBox: "0 0 362 145",
98
+ className: classes.image,
99
+ children: /* @__PURE__ */ jsx("path", {
100
+ fill: "currentColor",
101
+ d: "M62.6 142c-2.133 0-3.2-1.067-3.2-3.2V118h-56c-2 0-3-1-3-3V92.8c0-1.333.4-2.733 1.2-4.2L58.2 4c.8-1.333 2.067-2 3.8-2h28c2 0 3 1 3 3v85.4h11.2c.933 0 1.733.333 2.4 1 .667.533 1 1.267 1 2.2v21.2c0 .933-.333 1.733-1 2.4-.667.533-1.467.8-2.4.8H93v20.8c0 2.133-1.067 3.2-3.2 3.2H62.6zM33 90.4h26.4V51.2L33 90.4zM181.67 144.6c-7.333 0-14.333-1.333-21-4-6.666-2.667-12.866-6.733-18.6-12.2-5.733-5.467-10.266-13-13.6-22.6-3.333-9.6-5-20.667-5-33.2 0-12.533 1.667-23.6 5-33.2 3.334-9.6 7.867-17.133 13.6-22.6 5.734-5.467 11.934-9.533 18.6-12.2 6.667-2.8 13.667-4.2 21-4.2 7.467 0 14.534 1.4 21.2 4.2 6.667 2.667 12.8 6.733 18.4 12.2 5.734 5.467 10.267 13 13.6 22.6 3.334 9.6 5 20.667 5 33.2 0 12.533-1.666 23.6-5 33.2-3.333 9.6-7.866 17.133-13.6 22.6-5.6 5.467-11.733 9.533-18.4 12.2-6.666 2.667-13.733 4-21.2 4zm0-31c9.067 0 15.6-3.733 19.6-11.2 4.134-7.6 6.2-17.533 6.2-29.8s-2.066-22.2-6.2-29.8c-4.133-7.6-10.666-11.4-19.6-11.4-8.933 0-15.466 3.8-19.6 11.4-4 7.6-6 17.533-6 29.8s2 22.2 6 29.8c4.134 7.467 10.667 11.2 19.6 11.2zM316.116 142c-2.134 0-3.2-1.067-3.2-3.2V118h-56c-2 0-3-1-3-3V92.8c0-1.333.4-2.733 1.2-4.2l56.6-84.6c.8-1.333 2.066-2 3.8-2h28c2 0 3 1 3 3v85.4h11.2c.933 0 1.733.333 2.4 1 .666.533 1 1.267 1 2.2v21.2c0 .933-.334 1.733-1 2.4-.667.533-1.467.8-2.4.8h-11.2v20.8c0 2.133-1.067 3.2-3.2 3.2h-27.2zm-29.6-51.6h26.4V51.2l-26.4 39.2z"
102
+ })
103
+ });
104
+ $[6] = t1;
105
+ } else t1 = $[6];
106
+ let t2;
107
+ let t3;
108
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
109
+ t2 = /* @__PURE__ */ jsx(Title, {
110
+ className: classes.title,
111
+ children: "Nothing to see here"
112
+ });
113
+ t3 = /* @__PURE__ */ jsx(Text, {
114
+ c: "dimmed",
115
+ size: "lg",
116
+ ta: "center",
117
+ className: classes.description,
118
+ children: "Page you are trying to open does not exist. You may have mistyped the address, or the page has been moved to another URL. If you think this is an error contact support."
119
+ });
120
+ $[7] = t2;
121
+ $[8] = t3;
122
+ } else {
123
+ t2 = $[7];
124
+ t3 = $[8];
125
+ }
126
+ let t4;
127
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
128
+ t4 = /* @__PURE__ */ jsx(Container, {
129
+ className: classes.root,
130
+ children: /* @__PURE__ */ jsxs("div", {
131
+ className: classes.inner,
132
+ children: [t1, /* @__PURE__ */ jsxs("div", {
133
+ className: classes.content,
134
+ children: [
135
+ t2,
136
+ t3,
137
+ /* @__PURE__ */ jsx(Group, {
138
+ justify: "center",
139
+ children: /* @__PURE__ */ jsx(Button, {
140
+ component: Link,
141
+ to: "/",
142
+ search: true,
143
+ size: "md",
144
+ children: "Take me back to home page"
145
+ })
146
+ })
147
+ ]
148
+ })]
149
+ })
150
+ });
151
+ $[9] = t4;
152
+ } else t4 = $[9];
153
+ return t4;
154
+ }
155
+ export { NotFound };
@@ -0,0 +1,9 @@
1
+ import { l as styled } from "../chunks/styled-system.mjs";
2
+ // src/components/ViewOutlet.tsx
3
+ var ViewOutlet = styled("div", { base: {
4
+ padding: "0",
5
+ margin: "0",
6
+ width: "full",
7
+ height: "full"
8
+ } });
9
+ export { ViewOutlet };
@@ -0,0 +1,44 @@
1
+ import "../../chunks/rolldown-runtime.mjs";
2
+ import { compareLookupModel } from "./compare-model.mjs";
3
+ import { useCompareView } from "./ModelDiffPanel.mjs";
4
+ import { useModelDiffState } from "./state.mjs";
5
+ import { c } from "react/compiler-runtime";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import { LikeC4ModelProvider, useLikeC4Model } from "likec4/react";
8
+ // src/components/model-diff/CompareModelProvider.tsx
9
+ /**
10
+ * While a diff is selected, detail popups read the model that matches the compare view.
11
+ */
12
+ function CompareModelProvider(t0) {
13
+ const $ = c(8);
14
+ const { viewId, children } = t0;
15
+ const before = useLikeC4Model();
16
+ const compareView = useCompareView(viewId);
17
+ const { diffId, mode } = useModelDiffState();
18
+ let t1;
19
+ if ($[0] !== before || $[1] !== compareView || $[2] !== diffId || $[3] !== mode) {
20
+ t1 = compareView && diffId ? compareLookupModel(before, {
21
+ diffId,
22
+ mode,
23
+ view: compareView
24
+ }) : before;
25
+ $[0] = before;
26
+ $[1] = compareView;
27
+ $[2] = diffId;
28
+ $[3] = mode;
29
+ $[4] = t1;
30
+ } else t1 = $[4];
31
+ const model = t1;
32
+ let t2;
33
+ if ($[5] !== children || $[6] !== model) {
34
+ t2 = /* @__PURE__ */ jsx(LikeC4ModelProvider, {
35
+ likec4model: model,
36
+ children
37
+ });
38
+ $[5] = children;
39
+ $[6] = model;
40
+ $[7] = t2;
41
+ } else t2 = $[7];
42
+ return t2;
43
+ }
44
+ export { CompareModelProvider };