likec4 1.60.0 → 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.
- package/README.md +2 -0
- package/__app__/codegen/react.mjs +4 -10
- package/__app__/codegen/webcomponent.mjs +5 -208
- package/__app__/index.html +15 -15
- package/__app__/src/aichat/index.mjs +1 -2
- package/__app__/src/chunks/AIChat.mjs +292 -117
- package/__app__/src/chunks/ErrorComponent.mjs +444 -0
- package/__app__/src/chunks/Header.mjs +269 -0
- package/__app__/src/chunks/ViewReact.mjs +438 -0
- package/__app__/src/chunks/find.mjs +38 -0
- package/__app__/src/chunks/hooks.mjs +18 -541
- package/__app__/src/chunks/libs/@tabler/icons-react.mjs +340 -0
- package/__app__/src/chunks/libs/@tanstack-ai.mjs +11101 -1797
- package/__app__/src/chunks/libs/@tanstack.mjs +4563 -3083
- package/__app__/src/chunks/libs/fast-equals.mjs +140 -71
- package/__app__/src/chunks/{es.mjs → libs/html-to-image.mjs} +16 -22
- package/__app__/src/chunks/libs/nanostores.mjs +4 -8
- package/__app__/src/chunks/libs/react-resizable-panels.mjs +2792 -0
- package/__app__/src/chunks/react.mjs +22 -0
- package/__app__/src/chunks/rolldown-runtime.mjs +3 -32
- package/__app__/src/chunks/router.mjs +106 -0
- package/__app__/src/chunks/scope.mjs +106 -0
- package/__app__/src/chunks/searchParams.mjs +29 -0
- package/__app__/src/chunks/single-index.mjs +465 -0
- package/__app__/src/chunks/styled-system.mjs +1916 -2946
- package/__app__/src/chunks/useAsync.mjs +69 -0
- package/__app__/src/chunks/useSyncedRef.mjs +16 -0
- package/__app__/src/components/ColorSchemeToggle.mjs +124 -0
- package/__app__/src/components/CopyToClipboard.mjs +53 -0
- package/__app__/src/components/ErrorComponent.mjs +1 -0
- package/__app__/src/components/NavigationPanel.mjs +63 -0
- package/__app__/src/components/NotFound.mjs +155 -0
- package/__app__/src/components/ViewOutlet.mjs +9 -0
- package/__app__/src/components/model-diff/CompareModelProvider.mjs +44 -0
- package/__app__/src/components/model-diff/ModelDiffPanel.mjs +179 -0
- package/__app__/src/components/model-diff/compare-model.mjs +76 -0
- package/__app__/src/components/model-diff/state.mjs +45 -0
- package/__app__/src/components/search/OverviewSearch.mjs +92 -0
- package/__app__/src/components/search/OverviewSearchAdapter.mjs +94 -0
- package/__app__/src/components/sidebar/DiagramTree.css.mjs +48 -0
- package/__app__/src/components/sidebar/DiagramsTree.mjs +304 -0
- package/__app__/src/components/sidebar/Drawer.mjs +178 -0
- package/__app__/src/components/sidebar/SidebarBurger.mjs +28 -0
- package/__app__/src/components/sidebar/data.mjs +94 -0
- package/__app__/src/components/sidebar/state.mjs +16 -0
- package/__app__/src/components/view-page/Header.mjs +1 -0
- package/__app__/src/components/view-page/SelectProject.mjs +258 -0
- package/__app__/src/components/view-page/ShareModal.mjs +111 -0
- package/__app__/src/components/view-page/share-modal/AlertLocalhost.mjs +31 -0
- package/__app__/src/components/view-page/share-modal/CopyButtonChild.mjs +36 -0
- package/__app__/src/components/view-page/share-modal/EmbedPanel.mjs +100 -0
- package/__app__/src/components/view-page/share-modal/WebcomponentsPanel.mjs +264 -0
- package/__app__/src/components/view-page/state.mjs +17 -0
- package/__app__/src/context/LikeC4CustomizationContext.mjs +26 -0
- package/__app__/src/context/LikeC4IconRendererContext.mjs +29 -0
- package/__app__/src/context/LikeC4ModelContext.mjs +34 -0
- package/__app__/src/context/LikeC4ProjectsContext.mjs +40 -0
- package/__app__/src/context/ModelDiffsContext.mjs +33 -0
- package/__app__/src/context/safeCtx.mjs +14 -0
- package/__app__/src/hooks.mjs +1 -0
- package/__app__/src/main.mjs +4 -48126
- package/__app__/src/pages/EmbedPage.mjs +93 -0
- package/__app__/src/pages/ExportPage.mjs +691 -0
- package/__app__/src/pages/ProjectsOverview.mjs +23 -0
- package/__app__/src/pages/ViewAsD2.mjs +105 -0
- package/__app__/src/pages/ViewAsDot.mjs +65 -0
- package/__app__/src/pages/ViewAsMmd.mjs +109 -0
- package/__app__/src/pages/ViewAsPuml.mjs +105 -0
- package/__app__/src/pages/ViewEditor.mjs +220 -0
- package/__app__/src/pages/ViewReact.mjs +1 -0
- package/__app__/src/pages/export-layout.mjs +95 -0
- package/__app__/src/pages/export-page-params.mjs +9 -0
- package/__app__/src/pages/styles.css.mjs +23 -0
- package/__app__/src/routeTree.gen.mjs +105 -0
- package/__app__/src/router.mjs +1 -0
- package/__app__/src/routes/__root.mjs +65 -0
- package/__app__/src/routes/index.css.mjs +29 -0
- package/__app__/src/routes/index.mjs +32 -0
- package/__app__/src/routes/project._projectId/-components.mjs +100 -0
- package/__app__/src/routes/project._projectId/embed._viewId.mjs +5 -0
- package/__app__/src/routes/project._projectId/export._viewId.mjs +24 -0
- package/__app__/src/routes/project._projectId/index.mjs +14 -0
- package/__app__/src/routes/project._projectId/route.mjs +93 -0
- package/__app__/src/routes/project._projectId/view._viewId.d2.mjs +34 -0
- package/__app__/src/routes/project._projectId/view._viewId.dot.mjs +41 -0
- package/__app__/src/routes/project._projectId/view._viewId.index.mjs +7 -0
- package/__app__/src/routes/project._projectId/view._viewId.mjs +23 -0
- package/__app__/src/routes/project._projectId/view._viewId.mmd.mjs +39 -0
- package/__app__/src/routes/project._projectId/view._viewId.puml.mjs +34 -0
- package/__app__/src/routes/projects.mjs +36 -0
- package/__app__/src/routes/single-index.mjs +1 -0
- package/__app__/src/routes/webcomponent._.mjs +94 -0
- package/__app__/src/style.css +1156 -1147
- package/config/schema.json +26 -2
- package/dist/app/render-view-client.css +1 -1
- package/dist/app/render-view-client.js +375 -393
- package/dist/chunks/filenames.mjs +26 -20
- package/dist/chunks/generate-likec4.mjs +4 -4
- package/dist/chunks/index.d.mts +16 -15
- package/dist/chunks/index2.d.mts +7041 -3293
- package/dist/chunks/libs/@chenglou/pretext.mjs +9 -0
- package/dist/chunks/libs/@logtape/logtape.mjs +5 -5
- package/dist/chunks/libs/@ts-graphviz/common.d.mts +2 -4
- package/dist/chunks/libs/chevrotain.mjs +19 -19
- package/dist/chunks/libs/clone.mjs +1 -0
- package/dist/chunks/libs/eventemitter3.mjs +1 -1
- package/dist/chunks/libs/fast-equals.mjs +1 -0
- package/dist/chunks/libs/fontkit.mjs +1 -0
- package/dist/chunks/libs/langium.d.mts +80 -2933
- package/dist/chunks/libs/langium.mjs +6 -6
- package/dist/chunks/libs/pako.mjs +1 -1
- package/dist/chunks/libs/pathe.mjs +1 -1
- package/dist/chunks/libs/remeda.mjs +1 -1
- package/dist/chunks/node.mjs +110 -77
- package/dist/chunks/rolldown-runtime.mjs +1 -1
- package/dist/chunks/sequence-view.mjs +1 -1
- package/dist/chunks/vite-plugin.mjs +183 -164
- package/dist/cli/index.mjs +157 -101
- package/dist/config/index.d.mts +65 -4
- package/dist/config/index.mjs +1 -1
- package/dist/generators/likec4.d.mts +16 -64
- package/dist/index.d.mts +2 -4
- package/dist/model/index.d.mts +0 -10
- package/dist/vite-plugin/index.d.mts +83 -61
- package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +1 -2
- package/dist/vite-plugin/internal/index.d.mts +91 -17
- package/dist/vite-plugin/internal/index.mjs +156 -110
- package/package.json +60 -55
- package/react/index.d.mts +3010 -4014
- package/react/index.mjs +170 -171
- package/react/rolldown-runtime-CfRud99p.js +1 -0
- package/skills/likec4-dsl/SKILL.md +71 -25
- package/skills/likec4-dsl/evals/evals-public.json +5 -0
- package/skills/likec4-dsl/evals/grading-spec.json +15 -1
- package/skills/likec4-dsl/references/cli.md +39 -10
- package/skills/likec4-dsl/references/configuration.md +5 -5
- package/skills/likec4-dsl/references/diffs.md +52 -0
- package/skills/likec4-dsl/references/examples.md +2 -2
- package/skills/likec4-dsl/references/identifier-validity.md +31 -31
- package/skills/likec4-dsl/references/include-predicates-wildcards.md +16 -15
- package/skills/likec4-dsl/references/model.md +42 -11
- package/skills/likec4-dsl/references/specification.md +11 -7
- package/skills/likec4-dsl/references/troubleshooting.md +47 -42
- package/skills/likec4-dsl/references/views.md +2 -2
- package/vite-plugin-modules.d.ts +126 -51
- package/__app__/src/chunks/LikeC4Styles.mjs +0 -4522
- package/__app__/src/chunks/ProjectsOverview.mjs +0 -827
- package/__app__/src/chunks/libs/@floating-ui.mjs +0 -3286
- package/__app__/src/chunks/libs/@mantine.mjs +0 -17731
- package/__app__/src/chunks/libs/@xstate/react.mjs +0 -3471
- package/__app__/src/chunks/libs/@xyflow/react.mjs +0 -7927
- package/__app__/src/chunks/libs/bezier-js.mjs +0 -1593
- package/__app__/src/chunks/libs/d3.mjs +0 -4531
- package/__app__/src/chunks/libs/framer.mjs +0 -11331
- package/__app__/src/chunks/libs/zod.mjs +0 -5404
- package/dist/chunks/libs/@chevrotain/types.d.mts +0 -111
- package/react/rolldown-runtime-DnkiqaRY.js +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "../../chunks/rolldown-runtime.mjs";
|
|
2
|
+
import { _ as notFound, a as createFileRoute } from "../../chunks/libs/@tanstack.mjs";
|
|
3
|
+
import { ViewAsPuml } from "../../pages/ViewAsPuml.mjs";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { loadPumlSources } from "likec4:puml";
|
|
7
|
+
// src/routes/project.$projectId/view.$viewId.puml.tsx
|
|
8
|
+
var Route = createFileRoute("/project/$projectId/view/$viewId/puml")({
|
|
9
|
+
component: Page,
|
|
10
|
+
staleTime: Infinity,
|
|
11
|
+
loader: async ({ params, context }) => {
|
|
12
|
+
const projectId = context.projectId;
|
|
13
|
+
const { viewId } = params;
|
|
14
|
+
try {
|
|
15
|
+
const { pumlSource } = await loadPumlSources(projectId);
|
|
16
|
+
return { source: pumlSource(viewId) };
|
|
17
|
+
} catch (error) {
|
|
18
|
+
console.error(error);
|
|
19
|
+
throw notFound();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function Page() {
|
|
24
|
+
const $ = c(2);
|
|
25
|
+
const { source } = Route.useLoaderData();
|
|
26
|
+
let t0;
|
|
27
|
+
if ($[0] !== source) {
|
|
28
|
+
t0 = /* @__PURE__ */ jsx(ViewAsPuml, { pumlSource: source });
|
|
29
|
+
$[0] = source;
|
|
30
|
+
$[1] = t0;
|
|
31
|
+
} else t0 = $[1];
|
|
32
|
+
return t0;
|
|
33
|
+
}
|
|
34
|
+
export { Route };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "../chunks/rolldown-runtime.mjs";
|
|
2
|
+
import { s as Box } from "../chunks/styled-system.mjs";
|
|
3
|
+
import { a as createFileRoute, h as redirect } from "../chunks/libs/@tanstack.mjs";
|
|
4
|
+
import { lazy } from "react";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { pageTitle } from "likec4:app-config";
|
|
8
|
+
import { useDocumentTitle } from "@mantine/hooks";
|
|
9
|
+
// src/routes/projects.tsx
|
|
10
|
+
var ProjectsOverviewPage = lazy(async () => {
|
|
11
|
+
const { ProjectsOverviewPage } = await import("../pages/ProjectsOverview.mjs");
|
|
12
|
+
return { default: ProjectsOverviewPage };
|
|
13
|
+
});
|
|
14
|
+
var Route = createFileRoute("/projects")({
|
|
15
|
+
beforeLoad: async ({ context }) => {
|
|
16
|
+
if (context.projects.length < 2) throw redirect({ to: "/single-index/" });
|
|
17
|
+
},
|
|
18
|
+
component: RouteComponent,
|
|
19
|
+
wrapInSuspense: true
|
|
20
|
+
});
|
|
21
|
+
function RouteComponent() {
|
|
22
|
+
const $ = c(1);
|
|
23
|
+
useDocumentTitle(`Projects - ${pageTitle}`);
|
|
24
|
+
let t0;
|
|
25
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
26
|
+
t0 = /* @__PURE__ */ jsx(Box, {
|
|
27
|
+
w: "100%",
|
|
28
|
+
h: "100%",
|
|
29
|
+
overflow: "hidden",
|
|
30
|
+
children: /* @__PURE__ */ jsx(ProjectsOverviewPage, {})
|
|
31
|
+
});
|
|
32
|
+
$[0] = t0;
|
|
33
|
+
} else t0 = $[0];
|
|
34
|
+
return t0;
|
|
35
|
+
}
|
|
36
|
+
export { Route };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Route } from "../chunks/single-index.mjs";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import "../chunks/rolldown-runtime.mjs";
|
|
2
|
+
import { s as Box$1 } from "../chunks/styled-system.mjs";
|
|
3
|
+
import { a as createFileRoute, d as useRouter } from "../chunks/libs/@tanstack.mjs";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { ComponentName } from "likec4:app-config";
|
|
7
|
+
import { useMantineColorScheme } from "@mantine/core";
|
|
8
|
+
// src/routes/webcomponent.$.tsx
|
|
9
|
+
var Route = createFileRoute("/webcomponent/$")({ component: WebcomponentPage });
|
|
10
|
+
function WebcomponentPage() {
|
|
11
|
+
const $ = c(7);
|
|
12
|
+
const router = useRouter();
|
|
13
|
+
const viewId = Route.useParams()._splat || "index";
|
|
14
|
+
const { colorScheme } = useMantineColorScheme();
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] !== router.basepath) {
|
|
17
|
+
t0 = router.basepath.endsWith("/") ? router.basepath : `${router.basepath}/`;
|
|
18
|
+
$[0] = router.basepath;
|
|
19
|
+
$[1] = t0;
|
|
20
|
+
} else t0 = $[1];
|
|
21
|
+
const t1 = `${t0}likec4-views.js`;
|
|
22
|
+
let t2;
|
|
23
|
+
if ($[2] !== t1) {
|
|
24
|
+
t2 = new URL(t1, window.location.href);
|
|
25
|
+
$[2] = t1;
|
|
26
|
+
$[3] = t2;
|
|
27
|
+
} else t2 = $[3];
|
|
28
|
+
const jsurl = t2;
|
|
29
|
+
const iframeHtml = `
|
|
30
|
+
<!DOCTYPE html>
|
|
31
|
+
<html lang="en-US" style="color-scheme: ${colorScheme};">
|
|
32
|
+
<head>
|
|
33
|
+
<meta charset="utf-8" />
|
|
34
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no" />
|
|
35
|
+
<style>
|
|
36
|
+
* {
|
|
37
|
+
border-width: 0px;
|
|
38
|
+
border-style: solid;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
overflow-wrap: break-word;
|
|
41
|
+
}
|
|
42
|
+
html, body {
|
|
43
|
+
margin: 0;
|
|
44
|
+
background-color: transparent !important;
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
font-size: 16px;
|
|
48
|
+
}
|
|
49
|
+
body {
|
|
50
|
+
min-height: 100%;
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
53
|
+
</head>
|
|
54
|
+
<body>
|
|
55
|
+
<div style="width: 100%; height: 100%; padding: clamp(0.5rem, 5vh, 4rem) clamp(0.5rem, 5vw, 5rem)">
|
|
56
|
+
<${ComponentName.View} view-id="${encodeURIComponent(viewId)}"></${ComponentName.View}>
|
|
57
|
+
</div>
|
|
58
|
+
<script type="module" src="${jsurl.href}"><\/script>
|
|
59
|
+
</body>
|
|
60
|
+
</html>
|
|
61
|
+
`;
|
|
62
|
+
let t3;
|
|
63
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
64
|
+
t3 = {
|
|
65
|
+
position: "fixed",
|
|
66
|
+
inset: "0",
|
|
67
|
+
width: "100%",
|
|
68
|
+
height: "100%",
|
|
69
|
+
overflow: "hidden",
|
|
70
|
+
"& iframe": {
|
|
71
|
+
width: "100%",
|
|
72
|
+
height: "100%",
|
|
73
|
+
borderStyle: "none",
|
|
74
|
+
backgroundColor: "transparent",
|
|
75
|
+
overflow: "hidden"
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
$[4] = t3;
|
|
79
|
+
} else t3 = $[4];
|
|
80
|
+
let t4;
|
|
81
|
+
if ($[5] !== iframeHtml) {
|
|
82
|
+
t4 = /* @__PURE__ */ jsx(Box$1, {
|
|
83
|
+
css: t3,
|
|
84
|
+
children: /* @__PURE__ */ jsx("iframe", {
|
|
85
|
+
srcDoc: iframeHtml,
|
|
86
|
+
allowtransparency: "true"
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
$[5] = iframeHtml;
|
|
90
|
+
$[6] = t4;
|
|
91
|
+
} else t4 = $[6];
|
|
92
|
+
return t4;
|
|
93
|
+
}
|
|
94
|
+
export { Route };
|