likec4 1.59.4 → 1.60.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 (96) hide show
  1. package/__app__/codegen/react.mjs +6 -6
  2. package/__app__/codegen/webcomponent.mjs +147 -69
  3. package/__app__/src/aichat/index.mjs +10 -5
  4. package/__app__/src/chunks/AIChat.mjs +1134 -693
  5. package/__app__/src/chunks/LikeC4Styles.mjs +3995 -1779
  6. package/__app__/src/chunks/ProjectsOverview.mjs +624 -334
  7. package/__app__/src/chunks/es.mjs +515 -335
  8. package/__app__/src/chunks/hooks.mjs +578 -369
  9. package/__app__/src/chunks/libs/@floating-ui.mjs +2720 -1966
  10. package/__app__/src/chunks/libs/@mantine.mjs +13920 -10057
  11. package/__app__/src/chunks/libs/@tanstack-ai.mjs +2266 -1146
  12. package/__app__/src/chunks/libs/@tanstack.mjs +3152 -1926
  13. package/__app__/src/chunks/libs/@xstate/react.mjs +2924 -1468
  14. package/__app__/src/chunks/libs/@xyflow/react.mjs +6627 -4067
  15. package/__app__/src/chunks/libs/bezier-js.mjs +1312 -726
  16. package/__app__/src/chunks/libs/d3.mjs +3219 -1505
  17. package/__app__/src/chunks/libs/fast-equals.mjs +434 -210
  18. package/__app__/src/chunks/libs/framer.mjs +9251 -3846
  19. package/__app__/src/chunks/libs/nanostores.mjs +174 -0
  20. package/__app__/src/chunks/libs/zod.mjs +4591 -2363
  21. package/__app__/src/chunks/rolldown-runtime.mjs +39 -23
  22. package/__app__/src/chunks/styled-system.mjs +2279 -1951
  23. package/__app__/src/fonts.css +112 -1
  24. package/__app__/src/main.mjs +40817 -21840
  25. package/__app__/src/style.css +18488 -1
  26. package/config/schema.json +122 -97
  27. package/dist/app/render-view-client.css +1 -1
  28. package/dist/app/render-view-client.js +508 -334
  29. package/dist/chunks/enableServer.mjs +1 -1
  30. package/dist/chunks/filenames.mjs +11 -9
  31. package/dist/chunks/generate-likec4.mjs +5 -0
  32. package/dist/chunks/index.d.mts +243 -183
  33. package/dist/chunks/index2.d.mts +2865 -1977
  34. package/dist/chunks/libs/@chevrotain/gast.mjs +27 -1
  35. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +81 -9
  36. package/dist/chunks/libs/@chevrotain/types.d.mts +4 -1
  37. package/dist/chunks/libs/@logtape/logtape.mjs +5 -4
  38. package/dist/chunks/libs/@lume/kiwi.mjs +1 -1
  39. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
  40. package/dist/chunks/libs/birpc.mjs +1 -1
  41. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
  42. package/dist/chunks/libs/chevrotain.mjs +87 -35
  43. package/dist/chunks/libs/eventemitter3.mjs +1 -1
  44. package/dist/chunks/libs/json5.mjs +4 -4
  45. package/dist/chunks/libs/langium.d.mts +9038 -6193
  46. package/dist/chunks/libs/langium.mjs +16 -24
  47. package/dist/chunks/libs/merge-error-cause.mjs +1 -1
  48. package/dist/chunks/libs/p-limit.mjs +1 -0
  49. package/dist/chunks/libs/p-queue.mjs +1 -1
  50. package/dist/chunks/libs/package-manager-detector.mjs +1 -1
  51. package/dist/chunks/libs/pako.mjs +1 -1
  52. package/dist/chunks/libs/pretty-ms.mjs +1 -1
  53. package/dist/chunks/libs/remeda.mjs +1 -1
  54. package/dist/chunks/libs/ufo.mjs +1 -1
  55. package/dist/chunks/libs/unstorage.mjs +1 -1
  56. package/dist/chunks/libs/which.mjs +1 -1
  57. package/dist/chunks/node.mjs +59 -58
  58. package/dist/chunks/rolldown-runtime.mjs +1 -1
  59. package/dist/chunks/sequence-view.mjs +1 -1
  60. package/dist/chunks/vite-plugin.mjs +45 -45
  61. package/dist/cli/index.mjs +207 -1315
  62. package/dist/config/index.d.mts +2 -2
  63. package/dist/generators/likec4.d.mts +6578 -0
  64. package/dist/generators/likec4.mjs +1 -0
  65. package/dist/model/index.d.mts +4 -1
  66. package/dist/vite-plugin/index.d.mts +4 -1
  67. package/dist/vite-plugin/index.mjs +1 -1
  68. package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +9 -0
  69. package/dist/vite-plugin/internal/index.d.mts +6 -5
  70. package/dist/vite-plugin/internal/index.mjs +83 -30
  71. package/generators/likec4/package.json +4 -0
  72. package/package.json +113 -106
  73. package/react/index.d.mts +8500 -26659
  74. package/react/index.mjs +534 -63936
  75. package/react/rolldown-runtime-DnkiqaRY.js +1 -0
  76. package/skills/likec4-dsl/SKILL.md +428 -0
  77. package/skills/likec4-dsl/evals/evals-public.json +202 -0
  78. package/skills/likec4-dsl/evals/grading-spec.json +589 -0
  79. package/skills/likec4-dsl/references/bridge-leanix-drawio.md +42 -0
  80. package/skills/likec4-dsl/references/cli.md +139 -0
  81. package/skills/likec4-dsl/references/configuration.md +266 -0
  82. package/skills/likec4-dsl/references/deployment.md +160 -0
  83. package/skills/likec4-dsl/references/dynamic-views.md +455 -0
  84. package/skills/likec4-dsl/references/examples.md +370 -0
  85. package/skills/likec4-dsl/references/identifier-validity.md +90 -0
  86. package/skills/likec4-dsl/references/include-predicates-wildcards.md +179 -0
  87. package/skills/likec4-dsl/references/model.md +151 -0
  88. package/skills/likec4-dsl/references/predicates.md +123 -0
  89. package/skills/likec4-dsl/references/relationships-bidirectional.md +176 -0
  90. package/skills/likec4-dsl/references/specification.md +75 -0
  91. package/skills/likec4-dsl/references/style-tokens-colors.md +150 -0
  92. package/skills/likec4-dsl/references/troubleshooting.md +96 -0
  93. package/skills/likec4-dsl/references/views.md +329 -0
  94. package/dist/chunks/libs/picomatch.mjs +0 -1
  95. package/dist/chunks/libs/zod.d.mts +0 -3840
  96. package/dist/chunks/libs/zod.mjs +0 -65
@@ -1,10 +1,10 @@
1
1
  import "../src/chunks/rolldown-runtime.mjs";
2
- import { $likec4model as e, IconRenderer as t } from "likec4:single-project";
3
- import { LikeC4ModelProvider as n, LikeC4View as r, ReactLikeC4 as i, useLikeC4Model as a, useLikeC4View as o } from "likec4:react";
2
+ import { $likec4model, IconRenderer as RenderIcon } from "likec4:single-project";
3
+ import { LikeC4ModelProvider, LikeC4View, ReactLikeC4, useLikeC4Model, useLikeC4View } from "likec4:react";
4
4
  //#region codegen/react.tsx
5
- var s = e.get();
6
- function isLikeC4ViewId(e) {
7
- return e != null && typeof e == "string" && !!s.findView(e);
5
+ var likec4model = $likec4model.get();
6
+ function isLikeC4ViewId(value) {
7
+ return value != null && typeof value === "string" && !!likec4model.findView(value);
8
8
  }
9
9
  //#endregion
10
- export { n as LikeC4ModelProvider, r as LikeC4View, i as ReactLikeC4, t as RenderIcon, isLikeC4ViewId, s as likec4model, a as useLikeC4Model, o as useLikeC4View };
10
+ export { LikeC4ModelProvider, LikeC4View, ReactLikeC4, RenderIcon, isLikeC4ViewId, likec4model, useLikeC4Model, useLikeC4View };
@@ -1,107 +1,179 @@
1
1
  import "../src/chunks/rolldown-runtime.mjs";
2
- import { C as e, D as t, E as n, O as r, S as i, T as a, _ as o, b as s, d as c, f as l, g as u, h as d, l as f, m as p, p as m, u as h, v as g, w as _, x as v, y } from "../src/chunks/libs/zod.mjs";
3
- import { createRoot as b } from "react-dom/client";
4
- import { jsx as x } from "react/jsx-runtime";
5
- import { ComponentName as S } from "likec4:app-config";
6
- import { LikeC4View as C } from "likec4:react";
7
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/mini/schemas.js
8
- var w = /*@__PURE__*/ r("ZodMiniType", (t, n) => {
9
- if (!t._zod) throw Error("Uninitialized schema in ZodMiniType.");
10
- y.init(t, n), t.def = n, t.type = n.type, t.parse = (e, n) => s(t, e, n, { callee: t.parse }), t.safeParse = (e, n) => i(t, e, n), t.parseAsync = async (e, n) => v(t, e, n, { callee: t.parseAsync }), t.safeParseAsync = async (n, r) => e(t, n, r), t.check = (...e) => t.clone({
11
- ...n,
12
- checks: [...n.checks ?? [], ...e.map((e) => typeof e == "function" ? { _zod: {
13
- check: e,
14
- def: { check: "custom" },
15
- onattach: []
16
- } } : e)]
17
- }, { parent: !0 }), t.with = t.check, t.clone = (e, n) => _(t, e, n), t.brand = () => t, t.register = ((e, n) => (e.add(t, n), t)), t.apply = (e) => e(t);
18
- }), T = /*@__PURE__*/ r("ZodMiniString", (e, t) => {
19
- g.init(e, t), w.init(e, t);
2
+ import { C as safeParseAsync, D as normalizeParams, E as installLazyProp, O as own, S as safeParse, T as clone, _ as $ZodPipe, b as parse, d as $ZodBoolean, f as $ZodCodec, g as $ZodOptional, h as $ZodObject, k as shallowClone, l as _string, m as $ZodLiteral, p as $ZodDefault, u as _stringbool, v as $ZodString, w as $constructor, x as parseAsync, y as $ZodType } from "../src/chunks/libs/zod.mjs";
3
+ import { createRoot } from "react-dom/client";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { ComponentName } from "likec4:app-config";
6
+ import { LikeC4View as LikeC4View$1 } from "likec4:react";
7
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/mini/schemas.js
8
+ var ZodMiniType = /*@__PURE__*/ $constructor("ZodMiniType", (inst, def) => {
9
+ if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
10
+ $ZodType.init(inst, def);
11
+ inst.def = def;
12
+ inst.type = def.type;
13
+ }, {
14
+ get with() {
15
+ return this.check;
16
+ },
17
+ set with(value) {
18
+ own(this, "with", value);
19
+ },
20
+ parse(data, params) {
21
+ return parse(this, data, params, { callee: this.parse });
22
+ },
23
+ parseAsync(data, params) {
24
+ return parseAsync(this, data, params, { callee: this.parseAsync });
25
+ },
26
+ safeParse(data, params) {
27
+ return safeParse(this, data, params);
28
+ },
29
+ safeParseAsync(data, params) {
30
+ return safeParseAsync(this, data, params);
31
+ },
32
+ check(...checks) {
33
+ const def = this.def;
34
+ return this.clone({
35
+ ...def,
36
+ checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
37
+ check: ch,
38
+ def: { check: "custom" },
39
+ onattach: []
40
+ } } : ch)]
41
+ }, { parent: true });
42
+ },
43
+ clone(_def, params) {
44
+ return clone(this, _def, params);
45
+ },
46
+ brand() {
47
+ return this;
48
+ },
49
+ register(reg, meta) {
50
+ reg.add(this, meta);
51
+ return this;
52
+ },
53
+ apply(fn, ...args) {
54
+ return args.length === 0 ? fn(this) : fn(this, ...args);
55
+ }
56
+ });
57
+ var ZodMiniString = /*@__PURE__*/ $constructor("ZodMiniString", (inst, def) => {
58
+ $ZodString.init(inst, def);
59
+ ZodMiniType.init(inst, def);
20
60
  });
21
61
  // @__NO_SIDE_EFFECTS__
22
- function string(e) {
23
- return f(T, e);
62
+ function string(params) {
63
+ return _string(ZodMiniString, params);
24
64
  }
25
- var E = /*@__PURE__*/ r("ZodMiniBoolean", (e, t) => {
26
- c.init(e, t), w.init(e, t);
27
- }), D = /*@__PURE__*/ r("ZodMiniObject", (e, t) => {
28
- d.init(e, t), w.init(e, t), a(e, "shape", () => t.shape);
65
+ var ZodMiniBoolean = /*@__PURE__*/ $constructor("ZodMiniBoolean", (inst, def) => {
66
+ $ZodBoolean.init(inst, def);
67
+ ZodMiniType.init(inst, def);
68
+ });
69
+ var ZodMiniObject = /*@__PURE__*/ $constructor("ZodMiniObject", (inst, def) => {
70
+ $ZodObject.init(inst, def);
71
+ ZodMiniType.init(inst, def);
72
+ installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
29
73
  });
30
74
  // @__NO_SIDE_EFFECTS__
31
- function object(e, t) {
32
- return new D({
75
+ function object(shape, params) {
76
+ return new ZodMiniObject({
33
77
  type: "object",
34
- shape: e ?? {},
35
- ...n(t)
78
+ shape: shape ?? {},
79
+ ...normalizeParams(params)
36
80
  });
37
81
  }
38
- var O = /*@__PURE__*/ r("ZodMiniLiteral", (e, t) => {
39
- p.init(e, t), w.init(e, t);
82
+ var ZodMiniLiteral = /*@__PURE__*/ $constructor("ZodMiniLiteral", (inst, def) => {
83
+ $ZodLiteral.init(inst, def);
84
+ ZodMiniType.init(inst, def);
40
85
  });
41
86
  // @__NO_SIDE_EFFECTS__
42
- function literal(e, t) {
43
- return new O({
87
+ function literal(value, params) {
88
+ return new ZodMiniLiteral({
44
89
  type: "literal",
45
- values: Array.isArray(e) ? e : [e],
46
- ...n(t)
90
+ values: Array.isArray(value) ? value : [value],
91
+ ...normalizeParams(params)
47
92
  });
48
93
  }
49
- var k = /*@__PURE__*/ r("ZodMiniOptional", (e, t) => {
50
- u.init(e, t), w.init(e, t);
94
+ var ZodMiniOptional = /*@__PURE__*/ $constructor("ZodMiniOptional", (inst, def) => {
95
+ $ZodOptional.init(inst, def);
96
+ ZodMiniType.init(inst, def);
51
97
  });
52
98
  // @__NO_SIDE_EFFECTS__
53
- function optional(e) {
54
- return new k({
99
+ function optional(innerType) {
100
+ return new ZodMiniOptional({
55
101
  type: "optional",
56
- innerType: e
102
+ innerType
57
103
  });
58
104
  }
59
- var A = /*@__PURE__*/ r("ZodMiniDefault", (e, t) => {
60
- m.init(e, t), w.init(e, t);
105
+ var ZodMiniDefault = /*@__PURE__*/ $constructor("ZodMiniDefault", (inst, def) => {
106
+ $ZodDefault.init(inst, def);
107
+ ZodMiniType.init(inst, def);
61
108
  });
62
109
  // @__NO_SIDE_EFFECTS__
63
- function _default(e, n) {
64
- return new A({
110
+ function _default(innerType, defaultValue) {
111
+ return new ZodMiniDefault({
65
112
  type: "default",
66
- innerType: e,
113
+ innerType,
67
114
  get defaultValue() {
68
- return typeof n == "function" ? n() : t(n);
115
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
69
116
  }
70
117
  });
71
118
  }
72
- var j = /*@__PURE__*/ r("ZodMiniPipe", (e, t) => {
73
- o.init(e, t), w.init(e, t);
74
- }), M = /*@__PURE__*/ r("ZodMiniCodec", (e, t) => {
75
- j.init(e, t), l.init(e, t);
76
- }), stringbool = (...e) => h({
77
- Codec: M,
78
- Boolean: E,
79
- String: T
80
- }, ...e), N = /* @__PURE__ */ object({
119
+ var ZodMiniPipe = /*@__PURE__*/ $constructor("ZodMiniPipe", (inst, def) => {
120
+ $ZodPipe.init(inst, def);
121
+ ZodMiniType.init(inst, def);
122
+ });
123
+ var ZodMiniCodec = /*@__PURE__*/ $constructor("ZodMiniCodec", (inst, def) => {
124
+ ZodMiniPipe.init(inst, def);
125
+ $ZodCodec.init(inst, def);
126
+ });
127
+ var stringbool = (...args) => _stringbool({
128
+ Codec: ZodMiniCodec,
129
+ Boolean: ZodMiniBoolean,
130
+ String: ZodMiniString
131
+ }, ...args);
132
+ //#endregion
133
+ //#region codegen/webcomponent.tsx
134
+ var propsSchema = /* @__PURE__ */ object({
81
135
  viewId: /* @__PURE__ */ _default(/* @__PURE__ */ string(), "index"),
82
- browser: /* @__PURE__ */ _default(stringbool(), !0),
136
+ browser: /* @__PURE__ */ _default(stringbool(), true),
83
137
  dynamicViewVariant: /* @__PURE__ */ optional(/* @__PURE__ */ literal(["diagram", "sequence"])),
84
138
  colorScheme: /* @__PURE__ */ optional(/* @__PURE__ */ literal(["light", "dark"]))
85
- }), LikeC4View = class extends HTMLElement {
139
+ });
140
+ var LikeC4View = class extends HTMLElement {
86
141
  shadow;
87
142
  root;
88
143
  hostCss;
89
144
  lastHostCss = "";
90
145
  constructor() {
91
- super(), this.shadow = this.attachShadow({
146
+ super();
147
+ this.shadow = this.attachShadow({
92
148
  mode: "open",
93
- delegatesFocus: !0
149
+ delegatesFocus: true
94
150
  });
95
151
  }
96
152
  updateHostCss() {
97
- let e = "\n :host {\n display: contents;\n background-color: transparent;\n margin: 0;\n padding: 0;\n }";
98
- e !== this.lastHostCss && (this.hostCss?.replaceSync(e), this.lastHostCss = e);
153
+ const hostCss = `
154
+ :host {
155
+ display: contents;
156
+ background-color: transparent;
157
+ margin: 0;
158
+ padding: 0;
159
+ }`;
160
+ if (hostCss !== this.lastHostCss) {
161
+ this.hostCss?.replaceSync(hostCss);
162
+ this.lastHostCss = hostCss;
163
+ }
99
164
  }
100
165
  connectedCallback() {
101
- this.lastHostCss = "", this.hostCss = new CSSStyleSheet(), this.updateHostCss(), this.shadow.adoptedStyleSheets = [this.hostCss], this.render();
166
+ this.lastHostCss = "";
167
+ this.hostCss = new CSSStyleSheet();
168
+ this.updateHostCss();
169
+ this.shadow.adoptedStyleSheets = [this.hostCss];
170
+ this.render();
102
171
  }
103
172
  disconnectedCallback() {
104
- this.root?.unmount(), this.root = void 0, this.shadow.adoptedStyleSheets.length = 0, this.hostCss = void 0;
173
+ this.root?.unmount();
174
+ this.root = void 0;
175
+ this.shadow.adoptedStyleSheets.length = 0;
176
+ this.hostCss = void 0;
105
177
  }
106
178
  static observedAttributes = [
107
179
  "view-id",
@@ -110,22 +182,28 @@ var j = /*@__PURE__*/ r("ZodMiniPipe", (e, t) => {
110
182
  "color-scheme"
111
183
  ];
112
184
  getProps() {
113
- let e = N.safeParse({
185
+ const props = propsSchema.safeParse({
114
186
  viewId: this.getAttribute("view-id"),
115
187
  browser: this.getAttribute("browser") ?? void 0,
116
188
  dynamicViewVariant: this.getAttribute("dynamic-variant") ?? void 0,
117
189
  colorScheme: this.getAttribute("color-scheme") ?? void 0
118
190
  });
119
- return e.success ? e.data : (console.error("Invalid props", e.error), { viewId: "index" });
191
+ if (!props.success) {
192
+ console.error("Invalid props", props.error);
193
+ return { viewId: "index" };
194
+ }
195
+ return props.data;
120
196
  }
121
197
  render() {
122
- let e = this.getProps();
123
- this.updateHostCss(), this.root ??= b(this.shadow), this.root.render(/* @__PURE__ */ x(C, { ...e }));
198
+ const props = this.getProps();
199
+ this.updateHostCss();
200
+ this.root ??= createRoot(this.shadow);
201
+ this.root.render(/* @__PURE__ */ jsx(LikeC4View$1, { ...props }));
124
202
  }
125
- attributeChangedCallback(e) {
126
- this.root && this.render();
203
+ attributeChangedCallback(_name) {
204
+ if (this.root) this.render();
127
205
  }
128
206
  };
129
- customElements.define(S.View, LikeC4View);
207
+ customElements.define(ComponentName.View, LikeC4View);
130
208
  //#endregion
131
209
  export { LikeC4View };
@@ -1,8 +1,13 @@
1
1
  import "../chunks/rolldown-runtime.mjs";
2
- import { Suspense as e, lazy as t } from "react";
3
- import { jsx as n } from "react/jsx-runtime";
4
- import { isAIAvailable as r } from "likec4:rpc";
2
+ import { Suspense, lazy } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { isAIAvailable } from "likec4:rpc";
5
5
  //#region src/aichat/index.tsx
6
- var i = /* @__PURE__ */ t(() => import("../chunks/AIChat.mjs")), a = r ? () => /* @__PURE__ */ n(e, { children: /* @__PURE__ */ n(i, {}) }) : () => null;
6
+ var AIChat = /* @__PURE__ */ lazy(() => import("../chunks/AIChat.mjs"));
7
+ /**
8
+ * AI Chat component that is conditionally rendered based on AI availability
9
+ * Uses lazy loading to avoid importing AI components in environments where AI is not available
10
+ */
11
+ var LazyAIChat = isAIAvailable ? () => /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(AIChat, {}) }) : () => null;
7
12
  //#endregion
8
- export { a as LazyAIChat };
13
+ export { LazyAIChat };