likec4 1.59.3 → 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.
- package/__app__/codegen/react.mjs +6 -6
- package/__app__/codegen/webcomponent.mjs +147 -69
- package/__app__/src/aichat/index.mjs +10 -5
- package/__app__/src/chunks/AIChat.mjs +1134 -693
- package/__app__/src/chunks/LikeC4Styles.mjs +4101 -1737
- package/__app__/src/chunks/ProjectsOverview.mjs +624 -334
- package/__app__/src/chunks/es.mjs +515 -335
- package/__app__/src/chunks/hooks.mjs +578 -366
- package/__app__/src/chunks/libs/@floating-ui.mjs +2720 -1966
- package/__app__/src/chunks/libs/@mantine.mjs +14067 -9487
- package/__app__/src/chunks/libs/@tanstack-ai.mjs +2266 -1146
- package/__app__/src/chunks/libs/@tanstack.mjs +3152 -1932
- package/__app__/src/chunks/libs/@xstate/react.mjs +2924 -1468
- package/__app__/src/chunks/libs/@xyflow/react.mjs +6627 -4067
- package/__app__/src/chunks/libs/bezier-js.mjs +1312 -726
- package/__app__/src/chunks/libs/d3.mjs +3218 -1509
- package/__app__/src/chunks/libs/fast-equals.mjs +437 -201
- package/__app__/src/chunks/libs/framer.mjs +9251 -3846
- package/__app__/src/chunks/libs/nanostores.mjs +174 -0
- package/__app__/src/chunks/libs/zod.mjs +4591 -2363
- package/__app__/src/chunks/rolldown-runtime.mjs +39 -23
- package/__app__/src/chunks/styled-system.mjs +3538 -756
- package/__app__/src/fonts.css +112 -1
- package/__app__/src/main.mjs +44398 -24039
- package/__app__/src/style.css +18488 -1
- package/config/schema.json +136 -97
- package/dist/app/render-view-client.css +1 -1
- package/dist/app/render-view-client.js +506 -338
- package/dist/chunks/enableServer.mjs +1 -1
- package/dist/chunks/filenames.mjs +16 -14
- package/dist/chunks/generate-likec4.mjs +5 -0
- package/dist/chunks/index.d.mts +246 -180
- package/dist/chunks/index2.d.mts +2882 -1977
- package/dist/chunks/libs/@chevrotain/gast.mjs +27 -1
- package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +81 -9
- package/dist/chunks/libs/@chevrotain/types.d.mts +111 -0
- package/dist/chunks/libs/@logtape/logtape.mjs +5 -4
- package/dist/chunks/libs/@lume/kiwi.mjs +1 -1
- package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
- package/dist/chunks/libs/birpc.mjs +1 -1
- package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
- package/dist/chunks/libs/chevrotain.mjs +87 -35
- package/dist/chunks/libs/eventemitter3.mjs +1 -1
- package/dist/chunks/libs/json5.mjs +4 -4
- package/dist/chunks/libs/langium.d.mts +9903 -5297
- package/dist/chunks/libs/langium.mjs +16 -24
- package/dist/chunks/libs/merge-error-cause.mjs +1 -1
- package/dist/chunks/libs/p-limit.mjs +1 -0
- package/dist/chunks/libs/p-queue.mjs +1 -1
- package/dist/chunks/libs/package-manager-detector.mjs +1 -1
- package/dist/chunks/libs/pako.mjs +2 -2
- package/dist/chunks/libs/pretty-ms.mjs +1 -1
- package/dist/chunks/libs/remeda.mjs +1 -1
- package/dist/chunks/libs/ufo.mjs +1 -1
- package/dist/chunks/libs/unstorage.mjs +1 -1
- package/dist/chunks/libs/which.mjs +1 -1
- package/dist/chunks/node.mjs +60 -60
- package/dist/chunks/rolldown-runtime.mjs +1 -1
- package/dist/chunks/sequence-view.mjs +1 -1
- package/dist/chunks/vite-plugin.mjs +55 -52
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +208 -1300
- package/dist/config/index.d.mts +2 -2
- package/dist/generators/likec4.d.mts +6578 -0
- package/dist/generators/likec4.mjs +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/model/index.d.mts +8 -5
- package/dist/vite-plugin/index.d.mts +6 -3
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +9 -0
- package/dist/vite-plugin/internal/index.d.mts +16 -15
- package/dist/vite-plugin/internal/index.mjs +144 -46
- package/generators/likec4/package.json +4 -0
- package/package.json +117 -110
- package/react/index.d.mts +8500 -5399
- package/react/index.mjs +534 -58617
- package/react/rolldown-runtime-DnkiqaRY.js +1 -0
- package/skills/likec4-dsl/SKILL.md +428 -0
- package/skills/likec4-dsl/evals/evals-public.json +202 -0
- package/skills/likec4-dsl/evals/grading-spec.json +589 -0
- package/skills/likec4-dsl/references/bridge-leanix-drawio.md +42 -0
- package/skills/likec4-dsl/references/cli.md +139 -0
- package/skills/likec4-dsl/references/configuration.md +266 -0
- package/skills/likec4-dsl/references/deployment.md +160 -0
- package/skills/likec4-dsl/references/dynamic-views.md +455 -0
- package/skills/likec4-dsl/references/examples.md +370 -0
- package/skills/likec4-dsl/references/identifier-validity.md +90 -0
- package/skills/likec4-dsl/references/include-predicates-wildcards.md +179 -0
- package/skills/likec4-dsl/references/model.md +151 -0
- package/skills/likec4-dsl/references/predicates.md +123 -0
- package/skills/likec4-dsl/references/relationships-bidirectional.md +176 -0
- package/skills/likec4-dsl/references/specification.md +75 -0
- package/skills/likec4-dsl/references/style-tokens-colors.md +150 -0
- package/skills/likec4-dsl/references/troubleshooting.md +96 -0
- package/skills/likec4-dsl/references/views.md +329 -0
- package/vite-plugin-modules.d.ts +4 -2
- package/dist/chunks/libs/picomatch.mjs +0 -1
- package/dist/chunks/libs/zod.d.mts +0 -2140
- package/dist/chunks/libs/zod.mjs +0 -65
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../src/chunks/rolldown-runtime.mjs";
|
|
2
|
-
import { $likec4model
|
|
3
|
-
import { LikeC4ModelProvider
|
|
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
|
|
6
|
-
function isLikeC4ViewId(
|
|
7
|
-
return
|
|
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 {
|
|
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
|
|
3
|
-
import { createRoot
|
|
4
|
-
import { jsx
|
|
5
|
-
import { ComponentName
|
|
6
|
-
import { LikeC4View as
|
|
7
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
8
|
-
var
|
|
9
|
-
if (!
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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(
|
|
23
|
-
return
|
|
62
|
+
function string(params) {
|
|
63
|
+
return _string(ZodMiniString, params);
|
|
24
64
|
}
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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(
|
|
32
|
-
return new
|
|
75
|
+
function object(shape, params) {
|
|
76
|
+
return new ZodMiniObject({
|
|
33
77
|
type: "object",
|
|
34
|
-
shape:
|
|
35
|
-
...
|
|
78
|
+
shape: shape ?? {},
|
|
79
|
+
...normalizeParams(params)
|
|
36
80
|
});
|
|
37
81
|
}
|
|
38
|
-
var
|
|
39
|
-
|
|
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(
|
|
43
|
-
return new
|
|
87
|
+
function literal(value, params) {
|
|
88
|
+
return new ZodMiniLiteral({
|
|
44
89
|
type: "literal",
|
|
45
|
-
values: Array.isArray(
|
|
46
|
-
...
|
|
90
|
+
values: Array.isArray(value) ? value : [value],
|
|
91
|
+
...normalizeParams(params)
|
|
47
92
|
});
|
|
48
93
|
}
|
|
49
|
-
var
|
|
50
|
-
|
|
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(
|
|
54
|
-
return new
|
|
99
|
+
function optional(innerType) {
|
|
100
|
+
return new ZodMiniOptional({
|
|
55
101
|
type: "optional",
|
|
56
|
-
innerType
|
|
102
|
+
innerType
|
|
57
103
|
});
|
|
58
104
|
}
|
|
59
|
-
var
|
|
60
|
-
|
|
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(
|
|
64
|
-
return new
|
|
110
|
+
function _default(innerType, defaultValue) {
|
|
111
|
+
return new ZodMiniDefault({
|
|
65
112
|
type: "default",
|
|
66
|
-
innerType
|
|
113
|
+
innerType,
|
|
67
114
|
get defaultValue() {
|
|
68
|
-
return typeof
|
|
115
|
+
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
69
116
|
}
|
|
70
117
|
});
|
|
71
118
|
}
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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(),
|
|
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
|
-
})
|
|
139
|
+
});
|
|
140
|
+
var LikeC4View = class extends HTMLElement {
|
|
86
141
|
shadow;
|
|
87
142
|
root;
|
|
88
143
|
hostCss;
|
|
89
144
|
lastHostCss = "";
|
|
90
145
|
constructor() {
|
|
91
|
-
super()
|
|
146
|
+
super();
|
|
147
|
+
this.shadow = this.attachShadow({
|
|
92
148
|
mode: "open",
|
|
93
|
-
delegatesFocus:
|
|
149
|
+
delegatesFocus: true
|
|
94
150
|
});
|
|
95
151
|
}
|
|
96
152
|
updateHostCss() {
|
|
97
|
-
|
|
98
|
-
|
|
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 = ""
|
|
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()
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
123
|
-
this.updateHostCss()
|
|
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(
|
|
126
|
-
this.root
|
|
203
|
+
attributeChangedCallback(_name) {
|
|
204
|
+
if (this.root) this.render();
|
|
127
205
|
}
|
|
128
206
|
};
|
|
129
|
-
customElements.define(
|
|
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
|
|
3
|
-
import { jsx
|
|
4
|
-
import { isAIAvailable
|
|
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
|
|
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 {
|
|
13
|
+
export { LazyAIChat };
|