likec4 1.50.0 → 1.52.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 (46) hide show
  1. package/__app__/src/ProjectsOverview.js +1 -1
  2. package/__app__/src/likec4.js +277 -164
  3. package/__app__/src/main.js +2 -56
  4. package/__app__/src/routes/index.js +85 -18
  5. package/__app__/src/routes/projects.js +1 -1
  6. package/__app__/src/routes/single.js +433 -53
  7. package/__app__/src/style.css +1 -1
  8. package/__app__/src/vendors.js +18646 -17381
  9. package/__app__/src/webcomponent.js +1 -1
  10. package/config/schema.json +1 -1
  11. package/dist/THIRD-PARTY-LICENSES.md +183 -285
  12. package/dist/_chunks/LikeC4.mjs +1 -1154
  13. package/dist/_chunks/filesystem.mjs +1229 -0
  14. package/dist/_chunks/index2.d.mts +49 -18
  15. package/dist/_chunks/libs/@hono/mcp.mjs +9 -9
  16. package/dist/_chunks/libs/@hono/node-server.mjs +1 -1
  17. package/dist/_chunks/libs/@logtape/logtape.mjs +1 -1
  18. package/dist/_chunks/libs/@modelcontextprotocol/sdk.d.mts +13 -13
  19. package/dist/_chunks/libs/ansi-align.mjs +2 -0
  20. package/dist/_chunks/libs/ansi-regex.mjs +1 -0
  21. package/dist/_chunks/libs/ansi-styles.mjs +1 -0
  22. package/dist/_chunks/libs/atomically.mjs +1 -1
  23. package/dist/_chunks/libs/boxen.d.mts +1 -0
  24. package/dist/_chunks/libs/boxen.mjs +22 -0
  25. package/dist/_chunks/libs/conf.mjs +1 -1
  26. package/dist/_chunks/libs/langium.d.mts +1 -1
  27. package/dist/_chunks/libs/langium.mjs +17 -17
  28. package/dist/_chunks/libs/remeda.mjs +2 -2
  29. package/dist/_chunks/libs/tinyrainbow.mjs +1 -1
  30. package/dist/_chunks/libs/vscode-languageserver.mjs +1 -0
  31. package/dist/_chunks/sequence.mjs +1 -1
  32. package/dist/_chunks/src.mjs +1 -1
  33. package/dist/_chunks/src2.mjs +64 -64
  34. package/dist/cli/index.mjs +84 -74
  35. package/dist/index.d.mts +836 -1
  36. package/dist/index.mjs +1 -1
  37. package/dist/vite-plugin/index.mjs +1 -1
  38. package/dist/vite-plugin/internal.mjs +1 -1
  39. package/package.json +23 -24
  40. package/react/index.d.mts +56 -2
  41. package/react/index.mjs +1575 -595
  42. package/dist/_chunks/binary.mjs +0 -72
  43. package/dist/_chunks/libs/@logtape/logtape.d.mts +0 -741
  44. package/dist/_chunks/libs/@msgpack/msgpack.mjs +0 -1
  45. package/dist/_chunks/libs/@smithy/is-array-buffer.mjs +0 -1
  46. package/dist/_chunks/libs/@smithy/util-base64.mjs +0 -1
@@ -1,61 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { StrictMode } from "react";
3
3
  import { createRoot } from "react-dom/client";
4
- import { R as Routes } from "./routes/index.js";
5
- import { A as createTheme, T as Tooltip, P as Portal, S as SegmentedControl, M as MantineProvider } from "./vendors.js";
6
- const theme = createTheme({
7
- autoContrast: !0,
8
- primaryColor: "indigo",
9
- cursorType: "pointer",
10
- fontFamily: "var(--likec4-app-font)",
11
- headings: {
12
- fontWeight: "500",
13
- sizes: {
14
- h1: {
15
- // fontSize: '2rem',
16
- fontWeight: "600"
17
- },
18
- h2: {
19
- // fontSize: '1.85rem',
20
- }
21
- }
22
- },
23
- fontSizes: {
24
- xxs: "var(--font-sizes-xxs)",
25
- xs: "var(--font-sizes-xs)",
26
- sm: "var(--font-sizes-sm)",
27
- md: "var(--font-sizes-md)",
28
- lg: "var(--font-sizes-lg)",
29
- xl: "var(--font-sizes-xl)"
30
- },
31
- spacing: {
32
- xs: "var(--spacing-xs)",
33
- sm: "var(--spacing-sm)",
34
- md: "var(--spacing-md)",
35
- lg: "var(--spacing-lg)",
36
- xl: "var(--spacing-xl)"
37
- },
38
- components: {
39
- SegmentedControl: SegmentedControl.extend({
40
- vars: (theme2, props, ctx) => ({
41
- root: {
42
- // @ts-ignore
43
- "--sc-font-size": theme2.fontSizes[props.fz ?? props.size]
44
- }
45
- })
46
- }),
47
- Portal: Portal.extend({
48
- defaultProps: {
49
- reuseTargetNode: !0
50
- }
51
- }),
52
- Tooltip: Tooltip.extend({
53
- defaultProps: {
54
- color: "dark"
55
- }
56
- })
57
- }
58
- });
4
+ import { a as Routes } from "./routes/index.js";
59
5
  createRoot(document.getElementById("likec4-root")).render(
60
- /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(MantineProvider, { theme, defaultColorScheme: "auto", children: /* @__PURE__ */ jsx(Routes, {}) }) })
6
+ /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(Routes, {}) })
61
7
  );
@@ -1,10 +1,10 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { cY as useNavigate, bS as useCallbackRef, cZ as z, c_ as createRootRouteWithContext, a0 as t, c$ as stripSearchParams, d0 as Outlet, k as useMantineColorScheme, d1 as createFileRoute, d2 as redirect, d3 as useDocumentTitle, d4 as createRouter, d5 as createHashHistory, d6 as createBrowserHistory, d7 as RouterProvider } from "../vendors.js";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cY as useNavigate, bS as useCallbackRef, cZ as z, A as createTheme, T as Tooltip, P as Portal, S as SegmentedControl, c_ as createRootRouteWithContext, a0 as t, c$ as stripSearchParams, M as MantineProvider, d0 as Outlet, d1 as createFileRoute, d2 as redirect, d3 as useDocumentTitle, d4 as createRouter, d5 as createHashHistory, d6 as createBrowserHistory, d7 as RouterProvider } from "../vendors.js";
3
3
  import { useLikeC4Projects, projects } from "likec4:projects";
4
4
  import { R as Route$3, a as Route$4, b as Route$5, c as Route$9, d as Route$a, e as Route$b, f as Route$c, g as Route$d, h as Route$h, i as Route$i, j as Route$j, k as Route$k, F as Fallback, N as NotFound } from "./single.js";
5
5
  import { pageTitle, useHashHistory, basepath } from "../const.js";
6
6
  import { L as LikeC4ProjectsProvider, B as Box } from "../likec4.js";
7
- import { useEffect, lazy } from "react";
7
+ import { lazy } from "react";
8
8
  import { R as Route$6, a as Route$7, b as Route$8, c as Route$e, d as Route$f, e as Route$g, f as Route$l, g as Route$m, h as Route$n, i as Route$o, j as Route$p } from "./projects.js";
9
9
  function LikeC4ProjectsContext({ children }) {
10
10
  const projects2 = useLikeC4Projects(), navigate = useNavigate(), onProjectChange = useCallbackRef((projectId) => {
@@ -20,19 +20,83 @@ function LikeC4ProjectsContext({ children }) {
20
20
  );
21
21
  }
22
22
  const searchParamsSchema = z.object({
23
- theme: z.literal(["light", "dark", "auto"]).default("auto").catch("auto"),
23
+ theme: z.literal(["light", "dark", "auto"]).optional().catch(void 0),
24
24
  dynamic: z.enum(["diagram", "sequence"]).default("diagram").catch("diagram"),
25
25
  padding: z.number().min(0).default(20).catch(20),
26
- relationships: z.string().nonempty().optional().catch(void 0).transform((v) => v)
26
+ relationships: z.string().nonempty().optional().catch(void 0).transform((v) => v),
27
+ focusOnElement: z.string().nonempty().optional().catch(void 0).transform((v) => v)
28
+ });
29
+ function resolveForceColorScheme(theme2) {
30
+ switch (theme2) {
31
+ case "light":
32
+ case "dark":
33
+ return theme2;
34
+ default:
35
+ return;
36
+ }
37
+ }
38
+ const theme = createTheme({
39
+ autoContrast: !0,
40
+ primaryColor: "indigo",
41
+ cursorType: "pointer",
42
+ fontFamily: "var(--likec4-app-font)",
43
+ headings: {
44
+ fontWeight: "500",
45
+ sizes: {
46
+ h1: {
47
+ // fontSize: '2rem',
48
+ fontWeight: "600"
49
+ },
50
+ h2: {
51
+ // fontSize: '1.85rem',
52
+ }
53
+ }
54
+ },
55
+ fontSizes: {
56
+ xxs: "var(--font-sizes-xxs)",
57
+ xs: "var(--font-sizes-xs)",
58
+ sm: "var(--font-sizes-sm)",
59
+ md: "var(--font-sizes-md)",
60
+ lg: "var(--font-sizes-lg)",
61
+ xl: "var(--font-sizes-xl)"
62
+ },
63
+ spacing: {
64
+ xs: "var(--spacing-xs)",
65
+ sm: "var(--spacing-sm)",
66
+ md: "var(--spacing-md)",
67
+ lg: "var(--spacing-lg)",
68
+ xl: "var(--spacing-xl)"
69
+ },
70
+ components: {
71
+ SegmentedControl: SegmentedControl.extend({
72
+ vars: (theme2, props, ctx) => ({
73
+ root: {
74
+ // @ts-ignore
75
+ "--sc-font-size": theme2.fontSizes[props.fz ?? props.size]
76
+ }
77
+ })
78
+ }),
79
+ Portal: Portal.extend({
80
+ defaultProps: {
81
+ reuseTargetNode: !0
82
+ }
83
+ }),
84
+ Tooltip: Tooltip.extend({
85
+ defaultProps: {
86
+ color: "dark"
87
+ }
88
+ })
89
+ }
27
90
  }), Route$2 = createRootRouteWithContext()({
28
91
  validateSearch: searchParamsSchema,
29
92
  search: {
30
93
  middlewares: [
31
94
  stripSearchParams({
32
95
  padding: 20,
33
- theme: "auto",
96
+ theme: void 0,
34
97
  dynamic: "diagram",
35
- relationships: void 0
98
+ relationships: void 0,
99
+ focusOnElement: void 0
36
100
  })
37
101
  ]
38
102
  },
@@ -46,17 +110,18 @@ const searchParamsSchema = z.object({
46
110
  component: RootComponent
47
111
  });
48
112
  function RootComponent() {
49
- return /* @__PURE__ */ jsxs(Fragment, { children: [
50
- /* @__PURE__ */ jsx(Outlet, {}),
51
- /* @__PURE__ */ jsx(ThemeSync, {})
52
- ] });
113
+ const { theme: theme$1 } = Route$2.useSearch(), forceColorScheme = resolveForceColorScheme(theme$1);
114
+ return /* @__PURE__ */ jsx(
115
+ MantineProvider,
116
+ {
117
+ theme,
118
+ defaultColorScheme: "auto",
119
+ ...forceColorScheme && { forceColorScheme },
120
+ children: /* @__PURE__ */ jsx(Outlet, {})
121
+ }
122
+ );
53
123
  }
54
- const ThemeSync = () => {
55
- const { theme } = Route$2.useSearch(), mantineColorScheme = useMantineColorScheme();
56
- return useEffect(() => {
57
- theme && mantineColorScheme.setColorScheme(theme);
58
- }, [theme]), null;
59
- }, ProjectsOverviewPage = lazy(async () => {
124
+ const ProjectsOverviewPage = lazy(async () => {
60
125
  const { ProjectsOverviewPage: ProjectsOverviewPage2 } = await import("../ProjectsOverview.js");
61
126
  return {
62
127
  default: ProjectsOverviewPage2
@@ -246,5 +311,7 @@ function Routes() {
246
311
  return /* @__PURE__ */ jsx(RouterProvider, { router });
247
312
  }
248
313
  export {
249
- Routes as R
314
+ Route$2 as R,
315
+ Routes as a,
316
+ resolveForceColorScheme as r
250
317
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { d1 as createFileRoute, db as Container, bp as Stack, bZ as Title, W as Button, df as Link, dD as notFound, d2 as redirect, Q as m, d0 as Outlet, dE as Navigate, c$ as stripSearchParams, cZ as z } from "../vendors.js";
2
+ import { d1 as createFileRoute, db as Container, bp as Stack, bZ as Title, W as Button, df as Link, dG as notFound, d2 as redirect, Q as m, d0 as Outlet, dH as Navigate, c$ as stripSearchParams, cZ as z } from "../vendors.js";
3
3
  import { loadModel } from "likec4:model";
4
4
  import { V as ViewOutlet, F as Fallback, L as LikeC4IconRendererContext, l as LikeC4ModelContext, A as AdHocViewEditor, H as Header, E as ExportPage, m as EmbedPage, n as ViewEditor, o as ViewReact, p as ViewAsPuml, q as ViewAsMmd, r as ViewAsDot, s as ViewAsD2 } from "./single.js";
5
5
  import { isRpcAvailable } from "likec4:rpc";