likec4 1.59.3 → 1.59.4
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__/src/chunks/AIChat.mjs +108 -108
- package/__app__/src/chunks/LikeC4Styles.mjs +752 -604
- package/__app__/src/chunks/ProjectsOverview.mjs +72 -72
- package/__app__/src/chunks/es.mjs +1 -1
- package/__app__/src/chunks/hooks.mjs +94 -91
- package/__app__/src/chunks/libs/@floating-ui.mjs +3 -3
- package/__app__/src/chunks/libs/@mantine.mjs +1609 -892
- package/__app__/src/chunks/libs/@tanstack-ai.mjs +2 -2
- package/__app__/src/chunks/libs/@tanstack.mjs +4 -10
- package/__app__/src/chunks/libs/@xyflow/react.mjs +4 -4
- package/__app__/src/chunks/libs/d3.mjs +4 -9
- package/__app__/src/chunks/libs/fast-equals.mjs +61 -49
- package/__app__/src/chunks/libs/framer.mjs +6 -6
- package/__app__/src/chunks/styled-system.mjs +2578 -124
- package/__app__/src/main.mjs +21537 -20155
- package/__app__/src/style.css +1 -1
- package/config/schema.json +14 -0
- package/dist/app/render-view-client.css +1 -1
- package/dist/app/render-view-client.js +99 -105
- package/dist/chunks/filenames.mjs +6 -6
- package/dist/chunks/index.d.mts +7 -1
- package/dist/chunks/index2.d.mts +38 -21
- package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
- package/dist/chunks/libs/@chevrotain/types.d.mts +108 -0
- package/dist/chunks/libs/@logtape/logtape.mjs +4 -4
- package/dist/chunks/libs/langium.d.mts +1777 -16
- package/dist/chunks/libs/langium.mjs +4 -4
- 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/picomatch.mjs +1 -1
- 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/zod.d.mts +1717 -17
- package/dist/chunks/node.mjs +58 -59
- package/dist/chunks/vite-plugin.mjs +15 -12
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +104 -88
- package/dist/index.d.mts +3 -3
- package/dist/model/index.d.mts +4 -4
- package/dist/vite-plugin/index.d.mts +2 -2
- package/dist/vite-plugin/internal/index.d.mts +15 -15
- package/dist/vite-plugin/internal/index.mjs +72 -27
- package/package.json +28 -28
- package/react/index.d.mts +22720 -1460
- package/react/index.mjs +30391 -25072
- package/vite-plugin-modules.d.ts +4 -2
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { i as e } from "./rolldown-runtime.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { c as t } from "./libs/@tanstack.mjs";
|
|
3
3
|
import { C as n, F as r, N as i, O as a, _ as o, b as s, c, j as l, k as u, m as d, t as f, v as p, y as m } from "./hooks.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { C as
|
|
6
|
-
import { i as
|
|
7
|
-
import { a as
|
|
8
|
-
import { a as
|
|
9
|
-
import { createContext as
|
|
4
|
+
import { At as h, C as g, F as _, H as v, Z as ee, _t as te, b as y, et as b, nn as ne, r as re, v as ie, vt as x } from "./libs/@mantine.mjs";
|
|
5
|
+
import { C as S, L as C, T as w, y as T } from "./styled-system.mjs";
|
|
6
|
+
import { i as ae, m as oe } from "./libs/framer.mjs";
|
|
7
|
+
import { a as E, c as D, i as se, n as O, o as k, r as A, s as j, t as M } from "./libs/zod.mjs";
|
|
8
|
+
import { a as N, i as ce, n as le, r as ue, t as de } from "./libs/@tanstack-ai.mjs";
|
|
9
|
+
import { createContext as fe, use as pe, useEffect as me, useRef as P, useState as he } from "react";
|
|
10
10
|
import { c as F } from "react/compiler-runtime";
|
|
11
11
|
import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
12
|
-
import { RichText as ge, nonNullable as
|
|
13
|
-
import { ElementShapes as
|
|
14
|
-
import { AIAdapter as
|
|
15
|
-
//#region ../../node_modules/.pnpm/nanostores@1.5.
|
|
12
|
+
import { RichText as ge, nonNullable as _e, nonexhaustive as ve } from "@likec4/core";
|
|
13
|
+
import { ElementShapes as ye } from "@likec4/core/styles";
|
|
14
|
+
import { AIAdapter as be } from "likec4:rpc";
|
|
15
|
+
//#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/computed/index.js
|
|
16
16
|
var computedStore = (e, t, n) => {
|
|
17
17
|
Array.isArray(e) || (e = [e]);
|
|
18
18
|
let r, i, set = () => {
|
|
19
19
|
if (i === s.epoch) return;
|
|
20
20
|
i = s.epoch;
|
|
21
21
|
let n = e.map((e) => e.get());
|
|
22
|
-
if (!r
|
|
22
|
+
if (!r?.every((t, r) => e[r].eq(t, n[r]))) {
|
|
23
23
|
r = n;
|
|
24
24
|
let e = t(...n);
|
|
25
25
|
e && e.then && e.t ? e.then((e) => {
|
|
26
26
|
r === n && a.set(e);
|
|
27
27
|
}) : (a.set(e), i = s.epoch);
|
|
28
28
|
}
|
|
29
|
-
}, a = /* @__PURE__ */ m(
|
|
29
|
+
}, a = /* @__PURE__ */ m(), o = a.get;
|
|
30
30
|
a.get = () => (set(), o());
|
|
31
31
|
let c, l = n ? () => {
|
|
32
32
|
clearTimeout(c), c = setTimeout(set);
|
|
@@ -37,16 +37,16 @@ var computedStore = (e, t, n) => {
|
|
|
37
37
|
for (let e of t) e();
|
|
38
38
|
};
|
|
39
39
|
}), a;
|
|
40
|
-
}, batched = /* @__NO_SIDE_EFFECTS__ */ (e, t) => computedStore(e, t, !0),
|
|
40
|
+
}, batched = /* @__NO_SIDE_EFFECTS__ */ (e, t) => computedStore(e, t, !0), z = fe(null);
|
|
41
41
|
function useChatContext() {
|
|
42
|
-
return
|
|
42
|
+
return _e(pe(z), "useChatContext: ChatProvider is not provided");
|
|
43
43
|
}
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region src/aichat/ChatInput.tsx
|
|
46
46
|
function ChatInput() {
|
|
47
|
-
let e = F(22), { sendMessage: t, isLoading: n, messages: r, clear: i, stop: o } = useChatContext(), [s, c] =
|
|
47
|
+
let e = F(22), { sendMessage: t, isLoading: n, messages: r, clear: i, stop: o } = useChatContext(), [s, c] = he(""), l = P(null), t0;
|
|
48
48
|
e[0] !== n || e[1] !== t || e[2] !== s ? (t0 = () => {
|
|
49
|
-
|
|
49
|
+
s.trim() && !n && (t(s), c(""));
|
|
50
50
|
}, e[0] = n, e[1] = t, e[2] = s, e[3] = t0) : t0 = e[3];
|
|
51
51
|
let u = t0, t1;
|
|
52
52
|
e[4] === Symbol.for("react.memo_cache_sentinel") ? (t1 = (e) => c(e.target.value), e[4] = t1) : t1 = e[4];
|
|
@@ -55,7 +55,7 @@ function ChatInput() {
|
|
|
55
55
|
e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.metaKey && (e.preventDefault(), u());
|
|
56
56
|
}, e[5] = u, e[6] = t2);
|
|
57
57
|
let d;
|
|
58
|
-
e[7] !== n || e[8] !== t2 || e[9] !== s ? (d = /* @__PURE__ */ L(
|
|
58
|
+
e[7] !== n || e[8] !== t2 || e[9] !== s ? (d = /* @__PURE__ */ L(_, {
|
|
59
59
|
flex: 1,
|
|
60
60
|
className: "chat-input",
|
|
61
61
|
placeholder: "Your question...",
|
|
@@ -77,14 +77,14 @@ function ChatInput() {
|
|
|
77
77
|
children: "Clear"
|
|
78
78
|
}), e[11] = i, e[12] = n, e[13] = r.length, e[14] = f) : f = e[14];
|
|
79
79
|
let p;
|
|
80
|
-
e[15] !== n || e[16] !== o ? (p = n && /* @__PURE__ */ L(
|
|
80
|
+
e[15] !== n || e[16] !== o ? (p = n && /* @__PURE__ */ L(x, {
|
|
81
81
|
color: "red",
|
|
82
82
|
variant: "light",
|
|
83
83
|
onClick: () => o(),
|
|
84
84
|
children: /* @__PURE__ */ L(a, {})
|
|
85
85
|
}), e[15] = n, e[16] = o, e[17] = p) : p = e[17];
|
|
86
86
|
let m;
|
|
87
|
-
return e[18] !== d || e[19] !== f || e[20] !== p ? (m = /* @__PURE__ */ R(
|
|
87
|
+
return e[18] !== d || e[19] !== f || e[20] !== p ? (m = /* @__PURE__ */ R(S, { children: [
|
|
88
88
|
d,
|
|
89
89
|
f,
|
|
90
90
|
p
|
|
@@ -101,7 +101,7 @@ function ChatMessages() {
|
|
|
101
101
|
color: "red",
|
|
102
102
|
title: "Oops, something went wrong",
|
|
103
103
|
withCloseButton: !1,
|
|
104
|
-
children: /* @__PURE__ */ R(
|
|
104
|
+
children: /* @__PURE__ */ R(T, {
|
|
105
105
|
fontSize: "sm",
|
|
106
106
|
fontFamily: "mono",
|
|
107
107
|
whiteSpace: "pre",
|
|
@@ -117,18 +117,18 @@ function _temp(e) {
|
|
|
117
117
|
}
|
|
118
118
|
var ChatMessage = (e) => {
|
|
119
119
|
let t = F(4), { message: n } = e, r = n.role, i;
|
|
120
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i =
|
|
120
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = C({
|
|
121
121
|
color: "text.bright",
|
|
122
122
|
alignSelf: "flex-end",
|
|
123
123
|
paddingInline: "2",
|
|
124
124
|
paddingBlock: "1",
|
|
125
125
|
marginInlineEnd: "2",
|
|
126
126
|
rounded: "sm",
|
|
127
|
-
backgroundColor: "
|
|
127
|
+
backgroundColor: "surface.hover",
|
|
128
128
|
whiteSpace: "pre-wrap"
|
|
129
129
|
}), t[0] = i) : i = t[0];
|
|
130
130
|
let a = r === "user" ? UserMessageTextPart : MarkdownTextPart, o;
|
|
131
|
-
return t[1] !== n || t[2] !== a ? (o = /* @__PURE__ */ L(
|
|
131
|
+
return t[1] !== n || t[2] !== a ? (o = /* @__PURE__ */ L(de, {
|
|
132
132
|
message: n,
|
|
133
133
|
userClassName: i,
|
|
134
134
|
textPartRenderer: a
|
|
@@ -144,15 +144,15 @@ var ChatMessage = (e) => {
|
|
|
144
144
|
textScale: .95,
|
|
145
145
|
value: r
|
|
146
146
|
}), t[2] = r, t[3] = i), i;
|
|
147
|
-
},
|
|
147
|
+
}, B = /* @__PURE__ */ m(""), V = /* @__PURE__ */ m("closed"), xe = /* @__PURE__ */ batched([B, V], (e, t) => ({
|
|
148
148
|
log: e,
|
|
149
149
|
status: t
|
|
150
150
|
}));
|
|
151
151
|
function useSemanticLayoutLog() {
|
|
152
|
-
return o(
|
|
152
|
+
return o(xe);
|
|
153
153
|
}
|
|
154
154
|
function closeSemanticLayoutLog() {
|
|
155
|
-
|
|
155
|
+
V.set("closed"), B.set("");
|
|
156
156
|
}
|
|
157
157
|
//#endregion
|
|
158
158
|
//#region src/aichat/SemanticLayoutLog.tsx
|
|
@@ -160,17 +160,17 @@ function SemanticLayoutLog() {
|
|
|
160
160
|
let e = F(6), { log: t, status: n } = useSemanticLayoutLog();
|
|
161
161
|
if (n === "closed") return null;
|
|
162
162
|
let r = n === "completed", i;
|
|
163
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ L(
|
|
163
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ L(re, {
|
|
164
164
|
order: 4,
|
|
165
165
|
children: "Semantic Layout"
|
|
166
166
|
}), e[0] = i) : i = e[0];
|
|
167
167
|
let a = t || "Waiting for response...", o;
|
|
168
|
-
e[1] === a ? o = e[2] : (o = /* @__PURE__ */ L(
|
|
168
|
+
e[1] === a ? o = e[2] : (o = /* @__PURE__ */ L(T, {
|
|
169
169
|
whiteSpace: "pre-wrap",
|
|
170
170
|
children: a
|
|
171
171
|
}), e[1] = a, e[2] = o);
|
|
172
172
|
let s;
|
|
173
|
-
return e[3] !== r || e[4] !== o ? (s = /* @__PURE__ */ L(
|
|
173
|
+
return e[3] !== r || e[4] !== o ? (s = /* @__PURE__ */ L(g, {
|
|
174
174
|
size: "xl",
|
|
175
175
|
opened: !0,
|
|
176
176
|
onClose: closeSemanticLayoutLog,
|
|
@@ -183,57 +183,57 @@ function SemanticLayoutLog() {
|
|
|
183
183
|
}
|
|
184
184
|
//#endregion
|
|
185
185
|
//#region ../vite-plugin/src/ai/tools.ts
|
|
186
|
-
var
|
|
187
|
-
id:
|
|
188
|
-
title:
|
|
189
|
-
shape:
|
|
190
|
-
color:
|
|
191
|
-
icon:
|
|
192
|
-
parentId:
|
|
193
|
-
children: D(
|
|
194
|
-
x:
|
|
195
|
-
y:
|
|
196
|
-
width:
|
|
197
|
-
height:
|
|
198
|
-
modelFqn:
|
|
199
|
-
}),
|
|
186
|
+
var H = j({
|
|
187
|
+
id: D().meta({ description: "Node ID" }),
|
|
188
|
+
title: D(),
|
|
189
|
+
shape: M(ye),
|
|
190
|
+
color: D().meta({ description: "Node color, from theme or custom" }),
|
|
191
|
+
icon: D().nullish(),
|
|
192
|
+
parentId: D().nullish().meta({ description: "Parent node ID (if node is nested)" }),
|
|
193
|
+
children: O(D()).nullish().meta({ description: "Nested node IDs (if node is compound)" }),
|
|
194
|
+
x: k(),
|
|
195
|
+
y: k(),
|
|
196
|
+
width: k(),
|
|
197
|
+
height: k(),
|
|
198
|
+
modelFqn: D().nullish().meta({ description: "Model element FQN (if node has reference)" })
|
|
199
|
+
}), Se = N({
|
|
200
200
|
name: "read_ui",
|
|
201
201
|
description: "Read current UI state. Use arguments to include additional data.",
|
|
202
202
|
needsApproval: !1,
|
|
203
|
-
inputSchema:
|
|
204
|
-
selectedNode:
|
|
205
|
-
nodes:
|
|
203
|
+
inputSchema: j({
|
|
204
|
+
selectedNode: A().default(!1).meta({ description: "Include selected node (if any)" }),
|
|
205
|
+
nodes: A().default(!1).meta({ description: "Include all nodes from the view" })
|
|
206
206
|
}),
|
|
207
|
-
outputSchema:
|
|
208
|
-
projectId:
|
|
209
|
-
editMode:
|
|
210
|
-
view:
|
|
211
|
-
id:
|
|
212
|
-
title:
|
|
213
|
-
type:
|
|
207
|
+
outputSchema: j({
|
|
208
|
+
projectId: D(),
|
|
209
|
+
editMode: A().meta({ description: "Whether the UI is in edit mode" }),
|
|
210
|
+
view: j({
|
|
211
|
+
id: D(),
|
|
212
|
+
title: D(),
|
|
213
|
+
type: M([
|
|
214
214
|
"element",
|
|
215
215
|
"deployment",
|
|
216
216
|
"dynamic"
|
|
217
217
|
]).meta({ description: "Type of the current view" })
|
|
218
218
|
}).meta({ description: "Current view" }),
|
|
219
|
-
nodes:
|
|
220
|
-
selectedNode:
|
|
219
|
+
nodes: O(H).nullish(),
|
|
220
|
+
selectedNode: H.nullish()
|
|
221
221
|
})
|
|
222
|
-
}),
|
|
223
|
-
type:
|
|
224
|
-
elementId:
|
|
225
|
-
}).meta({ description: "Focus UI on an element by its FQN" }),
|
|
222
|
+
}), Ce = j({
|
|
223
|
+
type: E("focus"),
|
|
224
|
+
elementId: D().meta({ description: "Element ID (FQN)" })
|
|
225
|
+
}).meta({ description: "Focus UI on an element by its FQN" }), we = j({ type: E("fitview") }).meta({ description: "Zoom out to fit all elements in the viewport, and clear any selection/focus" }), Te = N({
|
|
226
226
|
name: "update_ui",
|
|
227
227
|
description: "Update UI state by executing a command.",
|
|
228
228
|
needsApproval: !1,
|
|
229
|
-
inputSchema:
|
|
230
|
-
outputSchema:
|
|
231
|
-
}),
|
|
229
|
+
inputSchema: j({ command: se("type", [Ce, we]) }),
|
|
230
|
+
outputSchema: j({})
|
|
231
|
+
}), Ee = N({
|
|
232
232
|
name: "navigate_to",
|
|
233
233
|
description: "Navigates UI to another view",
|
|
234
234
|
needsApproval: !1,
|
|
235
|
-
inputSchema:
|
|
236
|
-
outputSchema:
|
|
235
|
+
inputSchema: j({ viewId: D().meta({ description: "View ID" }) }),
|
|
236
|
+
outputSchema: j({})
|
|
237
237
|
}), DoubleIndexedKV = class {
|
|
238
238
|
constructor() {
|
|
239
239
|
this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
|
|
@@ -321,7 +321,7 @@ var CustomTransformerRegistry = class {
|
|
|
321
321
|
findByName(e) {
|
|
322
322
|
return this.transfomers[e];
|
|
323
323
|
}
|
|
324
|
-
},
|
|
324
|
+
}, De = /* @__PURE__ */ e((e) => Object.prototype.toString.call(e).slice(8, -1), "getType"), isUndefined = (e) => e === void 0, isNull = (e) => e === null, U = /* @__PURE__ */ e((e) => typeof e != "object" || !e || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null || Object.getPrototypeOf(e) === Object.prototype, "isPlainObject"), isEmptyObject = (e) => U(e) && Object.keys(e).length === 0, W = /* @__PURE__ */ e((e) => Array.isArray(e), "isArray"), isString = (e) => typeof e == "string", isNumber = (e) => typeof e == "number" && !isNaN(e), isBoolean = (e) => typeof e == "boolean", isRegExp = (e) => e instanceof RegExp, isMap = (e) => e instanceof Map, isSet = (e) => e instanceof Set, isSymbol = (e) => De(e) === "Symbol", isDate = (e) => e instanceof Date && !isNaN(e.valueOf()), isError = (e) => e instanceof Error, isNaNValue = (e) => typeof e == "number" && isNaN(e), isPrimitive = (e) => isBoolean(e) || isNull(e) || isUndefined(e) || isNumber(e) || isString(e) || isSymbol(e), isBigint = (e) => typeof e == "bigint", isInfinite = (e) => e === Infinity || e === -Infinity, isTypedArray = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), isURL = (e) => e instanceof URL, escapeKey = (e) => e.replace(/\\/g, "\\\\").replace(/\./g, "\\."), stringifyPath = (e) => e.map(String).map(escapeKey).join("."), parsePath = (e, t) => {
|
|
325
325
|
let n = [], r = "";
|
|
326
326
|
for (let i = 0; i < e.length; i++) {
|
|
327
327
|
let a = e.charAt(i);
|
|
@@ -356,7 +356,7 @@ function simpleTransformation(e, t, n, r) {
|
|
|
356
356
|
untransform: r
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
|
-
var
|
|
359
|
+
var G = [
|
|
360
360
|
simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
|
|
361
361
|
simpleTransformation(isBigint, "bigint", (e) => e.toString(), (e) => typeof BigInt < "u" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
|
|
362
362
|
simpleTransformation(isDate, "Date", (e) => e.toISOString(), (e) => new Date(e)),
|
|
@@ -392,11 +392,11 @@ function compositeTransformation(e, t, n, r) {
|
|
|
392
392
|
untransform: r
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
|
-
var
|
|
395
|
+
var K = compositeTransformation((e, t) => isSymbol(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, n) => {
|
|
396
396
|
let r = n.symbolRegistry.getValue(t[1]);
|
|
397
397
|
if (!r) throw Error("Trying to deserialize unknown symbol");
|
|
398
398
|
return r;
|
|
399
|
-
}),
|
|
399
|
+
}), q = [
|
|
400
400
|
Int8Array,
|
|
401
401
|
Uint8Array,
|
|
402
402
|
Int16Array,
|
|
@@ -407,7 +407,7 @@ var q = compositeTransformation((e, t) => isSymbol(e) ? !!t.symbolRegistry.getId
|
|
|
407
407
|
Float64Array,
|
|
408
408
|
Uint8ClampedArray
|
|
409
409
|
].reduce((e, t) => (e[t.name] = t, e), {}), J = compositeTransformation(isTypedArray, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
|
|
410
|
-
let n =
|
|
410
|
+
let n = q[t[1]];
|
|
411
411
|
if (!n) throw Error("Trying to deserialize unknown typed array");
|
|
412
412
|
return new n(e);
|
|
413
413
|
});
|
|
@@ -431,7 +431,7 @@ var Y = compositeTransformation(isInstanceOfRegisteredClass, (e, t) => ["class",
|
|
|
431
431
|
return r.deserialize(e);
|
|
432
432
|
}), Oe = [
|
|
433
433
|
Y,
|
|
434
|
-
|
|
434
|
+
K,
|
|
435
435
|
X,
|
|
436
436
|
J
|
|
437
437
|
], transformValue = (e, t) => {
|
|
@@ -440,18 +440,18 @@ var Y = compositeTransformation(isInstanceOfRegisteredClass, (e, t) => ["class",
|
|
|
440
440
|
value: n.transform(e, t),
|
|
441
441
|
type: n.annotation(e, t)
|
|
442
442
|
};
|
|
443
|
-
let r = findArr(
|
|
443
|
+
let r = findArr(G, (n) => n.isApplicable(e, t));
|
|
444
444
|
if (r) return {
|
|
445
445
|
value: r.transform(e, t),
|
|
446
446
|
type: r.annotation
|
|
447
447
|
};
|
|
448
448
|
}, Z = {};
|
|
449
|
-
|
|
449
|
+
G.forEach((e) => {
|
|
450
450
|
Z[e.annotation] = e;
|
|
451
451
|
});
|
|
452
452
|
var untransformValue = (e, t, n) => {
|
|
453
|
-
if (
|
|
454
|
-
case "symbol": return
|
|
453
|
+
if (W(t)) switch (t[0]) {
|
|
454
|
+
case "symbol": return K.untransform(e, t, n);
|
|
455
455
|
case "class": return Y.untransform(e, t, n);
|
|
456
456
|
case "custom": return X.untransform(e, t, n);
|
|
457
457
|
case "typed-array": return J.untransform(e, t, n);
|
|
@@ -494,10 +494,10 @@ var getDeep = (e, t) => {
|
|
|
494
494
|
let r = e;
|
|
495
495
|
for (let e = 0; e < t.length - 1; e++) {
|
|
496
496
|
let n = t[e];
|
|
497
|
-
if (
|
|
497
|
+
if (W(r)) {
|
|
498
498
|
let e = +n;
|
|
499
499
|
r = r[e];
|
|
500
|
-
} else if (
|
|
500
|
+
} else if (U(r)) r = r[n];
|
|
501
501
|
else if (isSet(r)) {
|
|
502
502
|
let e = +n;
|
|
503
503
|
r = getNthKey(r, e);
|
|
@@ -513,7 +513,7 @@ var getDeep = (e, t) => {
|
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
let i = t[t.length - 1];
|
|
516
|
-
if (
|
|
516
|
+
if (W(r) ? r[+i] = n(r[+i]) : U(r) && (r[i] = n(r[i])), isSet(r)) {
|
|
517
517
|
let e = getNthKey(r, +i), t = n(e);
|
|
518
518
|
e !== t && (r.delete(e), r.add(t));
|
|
519
519
|
}
|
|
@@ -533,7 +533,7 @@ var getDeep = (e, t) => {
|
|
|
533
533
|
function traverse(e, t, n, r = []) {
|
|
534
534
|
if (!e) return;
|
|
535
535
|
let i = enableLegacyPaths(n);
|
|
536
|
-
if (!
|
|
536
|
+
if (!W(e)) {
|
|
537
537
|
forEach(e, (e, a) => traverse(e, t, n, [...r, ...parsePath(a, i)]));
|
|
538
538
|
return;
|
|
539
539
|
}
|
|
@@ -555,7 +555,7 @@ function applyReferentialEqualityAnnotations(e, t, n) {
|
|
|
555
555
|
e = setDeep(e, t, () => i);
|
|
556
556
|
});
|
|
557
557
|
}
|
|
558
|
-
if (
|
|
558
|
+
if (W(t)) {
|
|
559
559
|
let [n, i] = t;
|
|
560
560
|
n.forEach((t) => {
|
|
561
561
|
e = setDeep(e, parsePath(t, r), () => e);
|
|
@@ -563,7 +563,7 @@ function applyReferentialEqualityAnnotations(e, t, n) {
|
|
|
563
563
|
} else forEach(t, apply);
|
|
564
564
|
return e;
|
|
565
565
|
}
|
|
566
|
-
var isDeep = (e, t) =>
|
|
566
|
+
var isDeep = (e, t) => U(e) || W(e) || isMap(e) || isSet(e) || isError(e) || isInstanceOfRegisteredClass(e, t);
|
|
567
567
|
function addIdentity(e, t, n) {
|
|
568
568
|
let r = n.get(e);
|
|
569
569
|
r ? r.push(t) : n.set(e, [t]);
|
|
@@ -592,11 +592,11 @@ var walker = (e, t, n, r, i = [], a = [], o = /* @__PURE__ */ new Map()) => {
|
|
|
592
592
|
return s || o.set(e, r), r;
|
|
593
593
|
}
|
|
594
594
|
if (includes(a, e)) return { transformedValue: null };
|
|
595
|
-
let c = transformValue(e, n), l = c?.value ?? e, u =
|
|
595
|
+
let c = transformValue(e, n), l = c?.value ?? e, u = W(l) ? [] : {}, d = {};
|
|
596
596
|
forEach(l, (s, c) => {
|
|
597
597
|
if (c === "__proto__" || c === "constructor" || c === "prototype") throw Error(`Detected property ${c}. This is a prototype pollution risk, please remove it from your object.`);
|
|
598
598
|
let l = walker(s, t, n, r, [...i, c], [...a, e], o);
|
|
599
|
-
u[c] = l.transformedValue,
|
|
599
|
+
u[c] = l.transformedValue, W(l.annotations) ? d[escapeKey(c)] = l.annotations : U(l.annotations) && forEach(l.annotations, (e, t) => {
|
|
600
600
|
d[escapeKey(c) + "." + t] = e;
|
|
601
601
|
});
|
|
602
602
|
});
|
|
@@ -756,10 +756,10 @@ function useChatTools() {
|
|
|
756
756
|
case "fitview":
|
|
757
757
|
o.fitDiagram();
|
|
758
758
|
break bb50;
|
|
759
|
-
default:
|
|
759
|
+
default: ve(t);
|
|
760
760
|
}
|
|
761
761
|
return {};
|
|
762
|
-
}, e[9] = o, e[10] = t3), s =
|
|
762
|
+
}, e[9] = o, e[10] = t3), s = ue(Ee.client(t1), Se.client(t2), Te.client(t3)), e[0] = o, e[1] = a, e[2] = n, e[3] = s;
|
|
763
763
|
} else s = e[3];
|
|
764
764
|
return s;
|
|
765
765
|
}
|
|
@@ -786,7 +786,7 @@ var Q = {
|
|
|
786
786
|
function useChat(e) {
|
|
787
787
|
let t = F(7), n;
|
|
788
788
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = {
|
|
789
|
-
connection:
|
|
789
|
+
connection: ce("/__likec4_ai"),
|
|
790
790
|
initialMessages: Q.read()
|
|
791
791
|
}, t[0] = n) : n = t[0];
|
|
792
792
|
let r = n, i = useChatTools(), a;
|
|
@@ -795,10 +795,10 @@ function useChat(e) {
|
|
|
795
795
|
...e,
|
|
796
796
|
tools: i
|
|
797
797
|
}, t[1] = e, t[2] = i, t[3] = a) : a = t[3];
|
|
798
|
-
let o =
|
|
798
|
+
let o = le(a), t3, s;
|
|
799
799
|
return t[4] === o.messages ? (t3 = t[5], s = t[6]) : (t3 = () => {
|
|
800
800
|
Q.write(o.messages);
|
|
801
|
-
}, s = [o.messages], t[4] = o.messages, t[5] = t3, t[6] = s),
|
|
801
|
+
}, s = [o.messages], t[4] = o.messages, t[5] = t3, t[6] = s), me(t3, s), o;
|
|
802
802
|
}
|
|
803
803
|
//#endregion
|
|
804
804
|
//#region src/aichat/AIChat.tsx
|
|
@@ -821,7 +821,7 @@ var $ = {
|
|
|
821
821
|
}
|
|
822
822
|
};
|
|
823
823
|
function AIChatComponent() {
|
|
824
|
-
let e =
|
|
824
|
+
let e = P(null);
|
|
825
825
|
e.current ||= $.read() ?? {
|
|
826
826
|
right: 16,
|
|
827
827
|
bottom: 100
|
|
@@ -835,10 +835,10 @@ function AIChatComponent() {
|
|
|
835
835
|
key: "likec4.ai.chat.collapsed",
|
|
836
836
|
defaultValue: !0
|
|
837
837
|
});
|
|
838
|
-
return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ R(
|
|
838
|
+
return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ R(oe, { children: [!t && /* @__PURE__ */ L(v, {
|
|
839
839
|
w: 300,
|
|
840
840
|
pos: "fixed",
|
|
841
|
-
className:
|
|
841
|
+
className: C({
|
|
842
842
|
rounded: "md",
|
|
843
843
|
padding: "xs",
|
|
844
844
|
shadow: "md",
|
|
@@ -850,7 +850,7 @@ function AIChatComponent() {
|
|
|
850
850
|
initialPosition: e.current,
|
|
851
851
|
onPositionChange,
|
|
852
852
|
children: /* @__PURE__ */ L(AIChatWindowContent, { onClose: () => n(!0) })
|
|
853
|
-
}), t && /* @__PURE__ */ L(
|
|
853
|
+
}), t && /* @__PURE__ */ L(ae.div, {
|
|
854
854
|
initial: {
|
|
855
855
|
opacity: .1,
|
|
856
856
|
translateX: "10%"
|
|
@@ -869,11 +869,11 @@ function AIChatComponent() {
|
|
|
869
869
|
bottom: 60,
|
|
870
870
|
zIndex: 1e3
|
|
871
871
|
},
|
|
872
|
-
children: /* @__PURE__ */ L(
|
|
872
|
+
children: /* @__PURE__ */ L(ie, {
|
|
873
873
|
label: "Show AI Assistant",
|
|
874
874
|
color: "dark",
|
|
875
875
|
fz: "xs",
|
|
876
|
-
children: /* @__PURE__ */ L(
|
|
876
|
+
children: /* @__PURE__ */ L(x, {
|
|
877
877
|
size: "lg",
|
|
878
878
|
variant: "gradient",
|
|
879
879
|
onClick: () => n(!1),
|
|
@@ -883,7 +883,7 @@ function AIChatComponent() {
|
|
|
883
883
|
}, "collapsed")] }), /* @__PURE__ */ L(SemanticLayoutLog, {})] });
|
|
884
884
|
}
|
|
885
885
|
function AIChatWindowContent(e) {
|
|
886
|
-
let t = F(15), { onClose: r } = e, i =
|
|
886
|
+
let t = F(15), { onClose: r } = e, i = P(null), t1;
|
|
887
887
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => {
|
|
888
888
|
i.current?.scrollIntoView();
|
|
889
889
|
}, t[0] = t1) : t1 = t[0];
|
|
@@ -894,21 +894,21 @@ function AIChatWindowContent(e) {
|
|
|
894
894
|
let o;
|
|
895
895
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (o = { onChunk: a }, t[2] = o) : o = t[2];
|
|
896
896
|
let s = useChat(o), c;
|
|
897
|
-
t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ R(
|
|
897
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ R(S, { children: [/* @__PURE__ */ L(T, {
|
|
898
898
|
textStyle: "likec4.panel",
|
|
899
|
-
|
|
899
|
+
nouserselect: !0,
|
|
900
900
|
children: "AI Assistant"
|
|
901
|
-
}), /* @__PURE__ */ L(
|
|
901
|
+
}), /* @__PURE__ */ L(b, {
|
|
902
902
|
size: "xs",
|
|
903
903
|
radius: "sm",
|
|
904
904
|
variant: "light",
|
|
905
|
-
children:
|
|
905
|
+
children: be
|
|
906
906
|
})] }), t[3] = c) : c = t[3];
|
|
907
907
|
let l;
|
|
908
|
-
t[4] === r ? l = t[5] : (l = /* @__PURE__ */ R(
|
|
908
|
+
t[4] === r ? l = t[5] : (l = /* @__PURE__ */ R(S, {
|
|
909
909
|
cursor: "move",
|
|
910
910
|
justify: "space-between",
|
|
911
|
-
children: [c, /* @__PURE__ */ L(
|
|
911
|
+
children: [c, /* @__PURE__ */ L(te, {
|
|
912
912
|
size: "sm",
|
|
913
913
|
onClick: (e) => {
|
|
914
914
|
e.stopPropagation(), r();
|
|
@@ -916,24 +916,24 @@ function AIChatWindowContent(e) {
|
|
|
916
916
|
})]
|
|
917
917
|
}), t[4] = r, t[5] = l);
|
|
918
918
|
let u;
|
|
919
|
-
t[6] === Symbol.for("react.memo_cache_sentinel") ? (u = { content:
|
|
919
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (u = { content: C({ display: "contents" }) }, t[6] = u) : u = t[6];
|
|
920
920
|
let d;
|
|
921
921
|
t[7] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ L(ChatMessages, {}), t[7] = d) : d = t[7];
|
|
922
922
|
let f, p;
|
|
923
|
-
t[8] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ L(
|
|
923
|
+
t[8] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ L(h, {
|
|
924
924
|
scrollbars: "y",
|
|
925
925
|
w: "100%",
|
|
926
926
|
flex: 1,
|
|
927
927
|
mih: 250,
|
|
928
928
|
mah: 350,
|
|
929
929
|
classNames: u,
|
|
930
|
-
children: /* @__PURE__ */ R(
|
|
930
|
+
children: /* @__PURE__ */ R(w, { children: [d, /* @__PURE__ */ L("div", {
|
|
931
931
|
ref: i,
|
|
932
932
|
style: { height: 2 }
|
|
933
933
|
})] })
|
|
934
934
|
}), p = /* @__PURE__ */ L(ChatInput, {}), t[8] = f, t[9] = p) : (f = t[8], p = t[9]);
|
|
935
935
|
let m;
|
|
936
|
-
t[10] === l ? m = t[11] : (m = /* @__PURE__ */ R(
|
|
936
|
+
t[10] === l ? m = t[11] : (m = /* @__PURE__ */ R(w, {
|
|
937
937
|
w: "100%",
|
|
938
938
|
children: [
|
|
939
939
|
l,
|
|
@@ -941,11 +941,11 @@ function AIChatWindowContent(e) {
|
|
|
941
941
|
p
|
|
942
942
|
]
|
|
943
943
|
}), t[10] = l, t[11] = m);
|
|
944
|
-
let
|
|
945
|
-
return t[12] !== s || t[13] !== m ? (
|
|
944
|
+
let g;
|
|
945
|
+
return t[12] !== s || t[13] !== m ? (g = /* @__PURE__ */ L(z, {
|
|
946
946
|
value: s,
|
|
947
947
|
children: m
|
|
948
|
-
}), t[12] = s, t[13] = m, t[14] =
|
|
948
|
+
}), t[12] = s, t[13] = m, t[14] = g) : g = t[14], g;
|
|
949
949
|
}
|
|
950
950
|
//#endregion
|
|
951
951
|
export { AIChatComponent as default };
|