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.
- 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 +3995 -1779
- package/__app__/src/chunks/ProjectsOverview.mjs +624 -334
- package/__app__/src/chunks/es.mjs +515 -335
- package/__app__/src/chunks/hooks.mjs +578 -369
- package/__app__/src/chunks/libs/@floating-ui.mjs +2720 -1966
- package/__app__/src/chunks/libs/@mantine.mjs +13920 -10057
- package/__app__/src/chunks/libs/@tanstack-ai.mjs +2266 -1146
- package/__app__/src/chunks/libs/@tanstack.mjs +3152 -1926
- 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 +3219 -1505
- package/__app__/src/chunks/libs/fast-equals.mjs +434 -210
- 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 +2279 -1951
- package/__app__/src/fonts.css +112 -1
- package/__app__/src/main.mjs +40817 -21840
- package/__app__/src/style.css +18488 -1
- package/config/schema.json +122 -97
- package/dist/app/render-view-client.css +1 -1
- package/dist/app/render-view-client.js +508 -334
- package/dist/chunks/enableServer.mjs +1 -1
- package/dist/chunks/filenames.mjs +11 -9
- package/dist/chunks/generate-likec4.mjs +5 -0
- package/dist/chunks/index.d.mts +243 -183
- package/dist/chunks/index2.d.mts +2865 -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 +4 -1
- 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 +9038 -6193
- 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 +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/which.mjs +1 -1
- package/dist/chunks/node.mjs +59 -58
- package/dist/chunks/rolldown-runtime.mjs +1 -1
- package/dist/chunks/sequence-view.mjs +1 -1
- package/dist/chunks/vite-plugin.mjs +45 -45
- package/dist/cli/index.mjs +207 -1315
- 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/model/index.d.mts +4 -1
- package/dist/vite-plugin/index.d.mts +4 -1
- 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 +6 -5
- package/dist/vite-plugin/internal/index.mjs +83 -30
- package/generators/likec4/package.json +4 -0
- package/package.json +113 -106
- package/react/index.d.mts +8500 -26659
- package/react/index.mjs +534 -63936
- 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/dist/chunks/libs/picomatch.mjs +0 -1
- package/dist/chunks/libs/zod.d.mts +0 -3840
- package/dist/chunks/libs/zod.mjs +0 -65
|
@@ -1,119 +1,139 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import { i as
|
|
3
|
-
import { ut as
|
|
4
|
-
import { I as
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { i as __name } from "./rolldown-runtime.mjs";
|
|
2
|
+
import { i as useMatches, u as useParams } from "./libs/@tanstack.mjs";
|
|
3
|
+
import { ut as Text } from "./libs/@mantine.mjs";
|
|
4
|
+
import { I as cx, k as Box, o as markdownBlock } from "./styled-system.mjs";
|
|
5
|
+
import { n as shallowEqual, t as deepEqual } from "./libs/fast-equals.mjs";
|
|
6
|
+
import { t as listenKeys } from "./libs/nanostores.mjs";
|
|
7
|
+
import { b as invariant } from "./libs/framer.mjs";
|
|
8
|
+
import { n as useSelector } from "./libs/@xstate/react.mjs";
|
|
9
|
+
import { createContext, createElement, forwardRef, use, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
10
|
+
import { c } from "react/compiler-runtime";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
import { useLikeC4Projects } from "likec4:projects";
|
|
13
|
+
//#region ../../node_modules/.pnpm/remeda@2.51.0/node_modules/remeda/dist/lazyDataLastImpl--3B10z3s.js
|
|
14
|
+
function e$2(e, t, n) {
|
|
15
|
+
let r = (n) => e(n, ...t);
|
|
16
|
+
return n === void 0 ? r : Object.assign(r, {
|
|
17
|
+
lazy: n,
|
|
18
|
+
lazyArgs: t
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
__name(e$2, "e");
|
|
21
22
|
//#endregion
|
|
22
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
23
|
-
function t$3(
|
|
24
|
-
let
|
|
25
|
-
if (
|
|
26
|
-
if (
|
|
27
|
-
throw Error(
|
|
23
|
+
//#region ../../node_modules/.pnpm/remeda@2.51.0/node_modules/remeda/dist/purry.js
|
|
24
|
+
function t$3(t, n, r) {
|
|
25
|
+
let i = t.length - n.length;
|
|
26
|
+
if (i === 0) return t(...n);
|
|
27
|
+
if (i === 1) return e$2(t, n, r);
|
|
28
|
+
throw Error(`Wrong number of arguments`);
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
+
__name(t$3, "t");
|
|
30
31
|
//#endregion
|
|
31
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
32
|
-
var
|
|
32
|
+
//#region ../../node_modules/.pnpm/remeda@2.51.0/node_modules/remeda/dist/utilityEvaluators-IxVD3t2o.js
|
|
33
|
+
var t$2 = {
|
|
33
34
|
done: !1,
|
|
34
35
|
hasNext: !1
|
|
35
|
-
}
|
|
36
|
+
};
|
|
37
|
+
var r$3 = /* @__PURE__ */ __name((e) => ({
|
|
36
38
|
hasNext: !0,
|
|
37
|
-
next:
|
|
39
|
+
next: e,
|
|
38
40
|
done: !1
|
|
39
41
|
}), "r");
|
|
40
42
|
//#endregion
|
|
41
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
42
|
-
function t$1(
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
//#region ../../node_modules/.pnpm/remeda@2.51.0/node_modules/remeda/dist/pipe.js
|
|
44
|
+
function t$1(e, ...t) {
|
|
45
|
+
let i = e;
|
|
46
|
+
let o = t.map((e) => `lazy` in e ? {
|
|
47
|
+
lazyEvaluator: e.lazy(...e.lazyArgs),
|
|
48
|
+
isSingle: e.lazy.single ?? !1,
|
|
46
49
|
index: 0,
|
|
47
50
|
items: []
|
|
48
|
-
} : void 0)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
} : void 0);
|
|
52
|
+
let s = 0;
|
|
53
|
+
for (; s < t.length;) {
|
|
54
|
+
if (o[s] === void 0 || !a$1(i)) {
|
|
55
|
+
let e = t[s];
|
|
56
|
+
i = e(i), s += 1;
|
|
53
57
|
continue;
|
|
54
58
|
}
|
|
55
|
-
let
|
|
56
|
-
|
|
59
|
+
let e = n$1(o, s), c = r$2(i, e), { isSingle: l } = e.at(-1);
|
|
60
|
+
i = l ? c[0] : c, s += e.length;
|
|
57
61
|
}
|
|
58
|
-
return
|
|
62
|
+
return i;
|
|
59
63
|
}
|
|
60
|
-
|
|
61
|
-
function n$1(
|
|
62
|
-
let
|
|
63
|
-
for (let
|
|
64
|
-
let
|
|
65
|
-
if (
|
|
64
|
+
__name(t$1, "t");
|
|
65
|
+
function n$1(e, t) {
|
|
66
|
+
let n = [];
|
|
67
|
+
for (let r = t; r < e.length; r++) {
|
|
68
|
+
let t = e[r];
|
|
69
|
+
if (t === void 0 || (n.push(t), t.isSingle)) break;
|
|
66
70
|
}
|
|
67
|
-
return
|
|
71
|
+
return n;
|
|
68
72
|
}
|
|
69
|
-
|
|
70
|
-
function r$2(
|
|
71
|
-
let
|
|
72
|
-
for (let
|
|
73
|
-
return
|
|
73
|
+
__name(n$1, "n");
|
|
74
|
+
function r$2(e, t) {
|
|
75
|
+
let n = [];
|
|
76
|
+
for (let r of e) if (i$1(r, n, t)) break;
|
|
77
|
+
return n;
|
|
74
78
|
}
|
|
75
|
-
|
|
76
|
-
function i$1(
|
|
77
|
-
if (
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
__name(r$2, "r");
|
|
80
|
+
function i$1(t, n, r) {
|
|
81
|
+
if (r.length === 0) return n.push(t), !1;
|
|
82
|
+
let a = t;
|
|
83
|
+
let o = t$2;
|
|
84
|
+
let s = !1;
|
|
85
|
+
for (let [e, { items: t, lazyEvaluator: c }] of r.entries()) if (t.push(a), o = c(a, t.length - 1, t), o.done && (s = !0), o.hasNext) {
|
|
86
|
+
if (o.hasMany ?? !1) {
|
|
87
|
+
for (let t of o.next) if (i$1(t, n, r.slice(e + 1))) return !0;
|
|
88
|
+
return s;
|
|
83
89
|
}
|
|
84
|
-
|
|
90
|
+
a = o.next;
|
|
85
91
|
} else break;
|
|
86
|
-
return
|
|
92
|
+
return o.hasNext && n.push(a), s;
|
|
87
93
|
}
|
|
88
|
-
|
|
89
|
-
function a$1(
|
|
90
|
-
return typeof
|
|
94
|
+
__name(i$1, "i");
|
|
95
|
+
function a$1(e) {
|
|
96
|
+
return typeof e == `string` || typeof e == `object` && !!e && Symbol.iterator in e;
|
|
91
97
|
}
|
|
92
|
-
|
|
98
|
+
__name(a$1, "a");
|
|
93
99
|
//#endregion
|
|
94
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
95
|
-
var
|
|
100
|
+
//#region ../../node_modules/.pnpm/remeda@2.51.0/node_modules/remeda/dist/toSingle-DiQSixar.js
|
|
101
|
+
var e$1 = /* @__PURE__ */ __name((e) => Object.assign(e, { single: !0 }), "e");
|
|
96
102
|
//#endregion
|
|
97
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
98
|
-
function r$1(...
|
|
99
|
-
return t$3(i,
|
|
103
|
+
//#region ../../node_modules/.pnpm/remeda@2.51.0/node_modules/remeda/dist/find.js
|
|
104
|
+
function r$1(...t) {
|
|
105
|
+
return t$3(i, t, e$1(a));
|
|
100
106
|
}
|
|
101
|
-
|
|
102
|
-
var i = (
|
|
107
|
+
__name(r$1, "r");
|
|
108
|
+
var i = (e, t) => e.find(t);
|
|
109
|
+
var a = (e) => (n, r, i) => e(n, r, i) ? {
|
|
103
110
|
done: !0,
|
|
104
111
|
hasNext: !0,
|
|
105
|
-
next:
|
|
106
|
-
} :
|
|
112
|
+
next: n
|
|
113
|
+
} : t$2;
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region ../../node_modules/.pnpm/remeda@2.51.0/node_modules/remeda/dist/isFunction.js
|
|
116
|
+
var e = (e) => typeof e == `function`;
|
|
107
117
|
//#endregion
|
|
108
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
109
|
-
function t(...
|
|
110
|
-
return t$3(n,
|
|
118
|
+
//#region ../../node_modules/.pnpm/remeda@2.51.0/node_modules/remeda/dist/map.js
|
|
119
|
+
function t(...t) {
|
|
120
|
+
return t$3(n, t, r);
|
|
111
121
|
}
|
|
112
|
-
var n = (
|
|
122
|
+
var n = (e, t) => e.map(t);
|
|
123
|
+
var r = (e) => (t, n, r) => ({
|
|
113
124
|
done: !1,
|
|
114
125
|
hasNext: !0,
|
|
115
|
-
next:
|
|
116
|
-
})
|
|
126
|
+
next: e(t, n, r)
|
|
127
|
+
});
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region ../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.0/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs
|
|
130
|
+
/**
|
|
131
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the MIT license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/
|
|
136
|
+
var defaultAttributes = {
|
|
117
137
|
outline: {
|
|
118
138
|
xmlns: "http://www.w3.org/2000/svg",
|
|
119
139
|
width: 24,
|
|
@@ -133,355 +153,544 @@ var n = (o, s) => o.map(s), r = (o) => (s, c, l) => ({
|
|
|
133
153
|
fill: "currentColor",
|
|
134
154
|
stroke: "none"
|
|
135
155
|
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
156
|
+
};
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region ../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.0/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs
|
|
159
|
+
/**
|
|
160
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the MIT license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/
|
|
165
|
+
var createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
166
|
+
const Component = forwardRef(({ color = "currentColor", size = 24, stroke = 2, title, className, children, ...rest }, ref) => createElement("svg", {
|
|
167
|
+
ref,
|
|
168
|
+
...defaultAttributes[type],
|
|
169
|
+
width: size,
|
|
170
|
+
height: size,
|
|
142
171
|
className: [
|
|
143
|
-
|
|
144
|
-
`tabler-icon-${
|
|
145
|
-
|
|
146
|
-
].join(" "),
|
|
147
|
-
...
|
|
148
|
-
strokeWidth:
|
|
149
|
-
stroke:
|
|
172
|
+
`tabler-icon`,
|
|
173
|
+
`tabler-icon-${iconName}`,
|
|
174
|
+
className
|
|
175
|
+
].filter(Boolean).join(" "),
|
|
176
|
+
...type === "filled" ? { fill: color } : {
|
|
177
|
+
strokeWidth: stroke,
|
|
178
|
+
stroke: color
|
|
150
179
|
},
|
|
151
|
-
...
|
|
180
|
+
...rest
|
|
152
181
|
}, [
|
|
153
|
-
|
|
154
|
-
...
|
|
155
|
-
...Array.isArray(
|
|
182
|
+
title && createElement("title", { key: "svg-title" }, title),
|
|
183
|
+
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
184
|
+
...Array.isArray(children) ? children : [children]
|
|
156
185
|
]));
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
186
|
+
Component.displayName = `${iconNamePascal}`;
|
|
187
|
+
return Component;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the MIT license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/
|
|
195
|
+
var IconSparkles = createReactComponent("outline", "sparkles", "Sparkles", [["path", {
|
|
196
|
+
"d": "M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6",
|
|
197
|
+
"key": "svg-0"
|
|
198
|
+
}]]);
|
|
199
|
+
/**
|
|
200
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the MIT license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/
|
|
205
|
+
var IconPlayerStopFilled = createReactComponent("filled", "player-stop-filled", "PlayerStopFilled", [["path", {
|
|
206
|
+
"d": "M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z",
|
|
207
|
+
"key": "svg-0"
|
|
164
208
|
}]]);
|
|
165
209
|
//#endregion
|
|
166
|
-
//#region ../../node_modules/.pnpm/@react-hookz+web@25.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
210
|
+
//#region ../../node_modules/.pnpm/@react-hookz+web@25.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@react-hookz/web/dist/useSyncedRef/index.js
|
|
211
|
+
/**
|
|
212
|
+
* Like `useRef`, but it returns immutable ref that contains actual value.
|
|
213
|
+
*
|
|
214
|
+
* @param value
|
|
215
|
+
*/
|
|
216
|
+
function useSyncedRef(value) {
|
|
217
|
+
const ref = useRef(value);
|
|
218
|
+
ref.current = value;
|
|
219
|
+
return useMemo(() => Object.freeze({ get current() {
|
|
220
|
+
return ref.current;
|
|
171
221
|
} }), []);
|
|
172
222
|
}
|
|
173
223
|
//#endregion
|
|
174
|
-
//#region ../../node_modules/.pnpm/@react-hookz+web@25.
|
|
175
|
-
var
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
224
|
+
//#region ../../node_modules/.pnpm/@react-hookz+web@25.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@react-hookz/web/dist/util/const.js
|
|
225
|
+
var noop$1 = /* @__PURE__ */ __name(() => {}, "noop");
|
|
226
|
+
var isBrowser = typeof globalThis !== "undefined" && typeof navigator !== "undefined" && typeof document !== "undefined";
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region ../../node_modules/.pnpm/@react-hookz+web@25.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@react-hookz/web/dist/util/misc.js
|
|
229
|
+
var basicDepsComparator = (d1, d2) => {
|
|
230
|
+
if (d1 === d2) return true;
|
|
231
|
+
if (d1.length !== d2.length) return false;
|
|
232
|
+
for (const [i, element] of d1.entries()) if (element !== d2[i]) return false;
|
|
233
|
+
return true;
|
|
180
234
|
};
|
|
181
235
|
//#endregion
|
|
182
|
-
//#region ../../node_modules/.pnpm/@react-hookz+web@25.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
236
|
+
//#region ../../node_modules/.pnpm/@react-hookz+web@25.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@react-hookz/web/dist/useCustomCompareEffect/index.js
|
|
237
|
+
/**
|
|
238
|
+
* Like `useEffect` but uses provided comparator function to validate dependency changes.
|
|
239
|
+
*
|
|
240
|
+
* @param callback Function that will be passed to the underlying effect hook.
|
|
241
|
+
* @param deps Dependency list like the one passed to `useEffect`.
|
|
242
|
+
* @param comparator Function that compares two dependency arrays,
|
|
243
|
+
* and returns `true` if they're equal.
|
|
244
|
+
* @param effectHook Effect hook that will be used to run
|
|
245
|
+
* `callback`. Must match the type signature of `useEffect`, meaning that the `callback` should be
|
|
246
|
+
* placed as the first argument and the dependency list as second.
|
|
247
|
+
* @param effectHookRestArgs Extra arguments that are passed to the `effectHook`
|
|
248
|
+
* after the `callback` and the dependency list.
|
|
249
|
+
*/
|
|
250
|
+
function useCustomCompareEffect(callback, deps, comparator = basicDepsComparator, effectHook = useEffect, ...effectHookRestArgs) {
|
|
251
|
+
const dependencies = useRef(void 0);
|
|
252
|
+
if (dependencies.current === void 0 || isBrowser && !comparator(dependencies.current, deps)) dependencies.current = deps;
|
|
253
|
+
effectHook(callback, dependencies.current, ...effectHookRestArgs);
|
|
186
254
|
}
|
|
187
255
|
//#endregion
|
|
188
|
-
//#region ../../node_modules/.pnpm/@react-hookz+web@25.
|
|
256
|
+
//#region ../../node_modules/.pnpm/@react-hookz+web@25.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@react-hookz/web/dist/useFirstMountState/index.js
|
|
257
|
+
/**
|
|
258
|
+
* Returns a boolean that is `true` only on first render.
|
|
259
|
+
*/
|
|
189
260
|
function useFirstMountState() {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}, [])
|
|
261
|
+
const isFirstMount = useRef(true);
|
|
262
|
+
useEffect(() => {
|
|
263
|
+
isFirstMount.current = false;
|
|
264
|
+
}, []);
|
|
265
|
+
return isFirstMount.current;
|
|
194
266
|
}
|
|
195
267
|
//#endregion
|
|
196
|
-
//#region ../../node_modules/.pnpm/@react-hookz+web@25.
|
|
197
|
-
|
|
198
|
-
|
|
268
|
+
//#region ../../node_modules/.pnpm/@react-hookz+web@25.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@react-hookz/web/dist/useIsomorphicLayoutEffect/index.js
|
|
269
|
+
/**
|
|
270
|
+
* Alias for `useLayoutEffect` in browser, but for `useEffect` at server side. Helps to avoid
|
|
271
|
+
* warning shown during SSR.
|
|
272
|
+
*/
|
|
273
|
+
var useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region ../../node_modules/.pnpm/@react-hookz+web@25.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@react-hookz/web/dist/useTimeoutEffect/index.js
|
|
276
|
+
var cancelTimeout = (id) => {
|
|
277
|
+
if (id) clearTimeout(id);
|
|
199
278
|
};
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
279
|
+
/**
|
|
280
|
+
* Like `setTimeout` but in the form of a react hook.
|
|
281
|
+
*
|
|
282
|
+
* @param callback Callback to be called after the timeout. Changing this
|
|
283
|
+
* will not reset the timeout.
|
|
284
|
+
* @param ms Timeout delay in milliseconds. `undefined` disables the timeout.
|
|
285
|
+
* Keep in mind, that changing this parameter will re-set timeout, meaning
|
|
286
|
+
* that it will be set as new after the change.
|
|
287
|
+
*/
|
|
288
|
+
function useTimeoutEffect(callback, ms) {
|
|
289
|
+
const cbRef = useSyncedRef(callback);
|
|
290
|
+
const msRef = useSyncedRef(ms);
|
|
291
|
+
const timeoutIdRef = useRef(null);
|
|
292
|
+
const cancel = useCallback(() => {
|
|
293
|
+
cancelTimeout(timeoutIdRef.current);
|
|
294
|
+
}, []);
|
|
295
|
+
const reset = useCallback(() => {
|
|
296
|
+
if (msRef.current === void 0) return;
|
|
297
|
+
cancel();
|
|
298
|
+
timeoutIdRef.current = setTimeout(() => {
|
|
299
|
+
cbRef.current();
|
|
300
|
+
}, msRef.current);
|
|
207
301
|
}, []);
|
|
208
|
-
|
|
302
|
+
useEffect(() => {
|
|
303
|
+
reset();
|
|
304
|
+
return cancel;
|
|
305
|
+
}, [ms]);
|
|
306
|
+
return [cancel, reset];
|
|
209
307
|
}
|
|
210
308
|
//#endregion
|
|
211
309
|
//#region ../diagram/src/hooks/useUpdateEffect.ts
|
|
212
|
-
var noop = () => {}
|
|
213
|
-
|
|
214
|
-
if (
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
useCustomCompareEffect(useFirstMountState() ? noop : o, s, c ?? depsShallowEqual, l);
|
|
220
|
-
}
|
|
221
|
-
//#endregion
|
|
222
|
-
//#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/atom/index.js
|
|
223
|
-
var V = [], H = 0, U = null, W = 4, G = globalThis.nanostoresGlobal ||= { epoch: 0 }, drainQueue = () => {
|
|
224
|
-
let o, s;
|
|
225
|
-
for (; H < V.length;) {
|
|
226
|
-
s = H, H += W;
|
|
227
|
-
try {
|
|
228
|
-
V[s](V[s + 1].value, V[s + 2], V[s + 3]);
|
|
229
|
-
} catch (s) {
|
|
230
|
-
o = s;
|
|
231
|
-
}
|
|
310
|
+
var noop = () => {};
|
|
311
|
+
var depsShallowEqual = (d1, d2) => {
|
|
312
|
+
if (d1 === d2) return true;
|
|
313
|
+
if (d1.length !== d2.length) return false;
|
|
314
|
+
for (const [i, element] of d1.entries()) {
|
|
315
|
+
if (element === d2[i] || shallowEqual(element, d2[i])) continue;
|
|
316
|
+
return false;
|
|
232
317
|
}
|
|
233
|
-
|
|
234
|
-
}, atom = /* @__NO_SIDE_EFFECTS__ */ (o) => {
|
|
235
|
-
let s = [], c = {
|
|
236
|
-
eq: Object.is,
|
|
237
|
-
get() {
|
|
238
|
-
return c.lc || c.listen(() => {})(), c.value;
|
|
239
|
-
},
|
|
240
|
-
init: o,
|
|
241
|
-
lc: 0,
|
|
242
|
-
listen(o) {
|
|
243
|
-
return c.lc = s.push(o), () => {
|
|
244
|
-
for (let s = H; s < V.length;) V[s] === o ? V.splice(s, W) : s += W;
|
|
245
|
-
let l = s.indexOf(o);
|
|
246
|
-
~l && (s.splice(l, 1), --c.lc || c.off());
|
|
247
|
-
};
|
|
248
|
-
},
|
|
249
|
-
notify(o, l) {
|
|
250
|
-
G.epoch++;
|
|
251
|
-
let u = !V.length && !0;
|
|
252
|
-
for (let u of s) U?.has(u) || (U?.add(u), V.push(u, c, o, l));
|
|
253
|
-
u && drainQueue();
|
|
254
|
-
},
|
|
255
|
-
off() {},
|
|
256
|
-
set(o) {
|
|
257
|
-
let s = c.value;
|
|
258
|
-
c.eq(s, o) || (c.value = o, c.notify(s));
|
|
259
|
-
},
|
|
260
|
-
subscribe(o) {
|
|
261
|
-
let s = c.listen(o);
|
|
262
|
-
return o(c.value), s;
|
|
263
|
-
},
|
|
264
|
-
value: o
|
|
265
|
-
};
|
|
266
|
-
return c;
|
|
267
|
-
}, K = 5, q = 6, J = 10, on = (o, s, c, l) => (o.events = o.events || {}, o.events[c + J] || (o.events[c + J] = l((s) => {
|
|
268
|
-
o.events[c].reduceRight((o, s) => (s(o), o), {
|
|
269
|
-
shared: {},
|
|
270
|
-
...s
|
|
271
|
-
});
|
|
272
|
-
})), o.events[c] = o.events[c] || [], o.events[c].push(s), () => {
|
|
273
|
-
let l = o.events[c], u = l.indexOf(s);
|
|
274
|
-
~u && (l.splice(u, 1), l.length || (o.events[c + J](), delete o.events[c + J]));
|
|
275
|
-
}), Y = 1e3, onMount = (o, s) => {
|
|
276
|
-
let listener = (c) => {
|
|
277
|
-
let l = s(c);
|
|
278
|
-
l && o.events[q].push(l);
|
|
279
|
-
};
|
|
280
|
-
return on(o, listener, K, (s) => {
|
|
281
|
-
let c = o.listen;
|
|
282
|
-
o.listen = (...l) => (!o.lc && !o.active && (o.active = !0, s()), c(...l));
|
|
283
|
-
let l = o.off;
|
|
284
|
-
return o.events[q] = [], o.off = () => {
|
|
285
|
-
l(), setTimeout(() => {
|
|
286
|
-
if (o.active && !o.lc) {
|
|
287
|
-
o.active = !1;
|
|
288
|
-
for (let s of o.events[q]) s();
|
|
289
|
-
o.events[q] = [];
|
|
290
|
-
}
|
|
291
|
-
}, Y);
|
|
292
|
-
}, () => {
|
|
293
|
-
o.listen = c, o.off = l;
|
|
294
|
-
};
|
|
295
|
-
});
|
|
318
|
+
return true;
|
|
296
319
|
};
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
function getPath(o, s) {
|
|
300
|
-
let c = getAllKeysFromPath(s), l = o;
|
|
301
|
-
for (let o of c) {
|
|
302
|
-
if (l == null) return;
|
|
303
|
-
l = l[o];
|
|
304
|
-
}
|
|
305
|
-
return l;
|
|
306
|
-
}
|
|
307
|
-
var X = /(.*)\[(\d+)\]/;
|
|
308
|
-
function getAllKeysFromPath(o) {
|
|
309
|
-
return o.split(".").flatMap((o) => getKeyAndIndicesFromKey(o));
|
|
310
|
-
}
|
|
311
|
-
function getKeyAndIndicesFromKey(o) {
|
|
312
|
-
if (X.test(o)) {
|
|
313
|
-
let [, s, c] = o.match(X);
|
|
314
|
-
return [...getKeyAndIndicesFromKey(s), c];
|
|
315
|
-
}
|
|
316
|
-
return [o];
|
|
320
|
+
function useUpdateEffect(callback, deps, equalityFn, effectHook) {
|
|
321
|
+
useCustomCompareEffect(useFirstMountState() ? noop : callback, deps, equalityFn ?? depsShallowEqual, effectHook);
|
|
317
322
|
}
|
|
318
323
|
//#endregion
|
|
319
|
-
//#region ../../node_modules/.pnpm
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
//#endregion
|
|
327
|
-
//#region ../../node_modules/.pnpm/@nanostores+react@1.1.0_nanostores@1.5.3_react@19.2.8/node_modules/@nanostores/react/index.js
|
|
328
|
-
var emit = (o, s) => (c) => {
|
|
329
|
-
o.current !== c && (o.current = c, s());
|
|
324
|
+
//#region ../../node_modules/.pnpm/@nanostores+react@2.0.1_nanostores@1.5.5_react@19.3.0/node_modules/@nanostores/react/index.js
|
|
325
|
+
var emit = (snapshotRef, onChange) => (value) => {
|
|
326
|
+
if (snapshotRef.current === value) return;
|
|
327
|
+
snapshotRef.current = value;
|
|
328
|
+
onChange();
|
|
330
329
|
};
|
|
331
|
-
function useStore(
|
|
332
|
-
let
|
|
333
|
-
|
|
334
|
-
let
|
|
335
|
-
|
|
330
|
+
function useStore(store, { keys, deps = [store, keys], ssr } = {}) {
|
|
331
|
+
let snapshotRef = useRef();
|
|
332
|
+
snapshotRef.current = store.get();
|
|
333
|
+
let subscribe = useCallback((onChange) => {
|
|
334
|
+
emit(snapshotRef, onChange)(store.value);
|
|
335
|
+
return keys?.length > 0 ? listenKeys(store, keys, emit(snapshotRef, onChange)) : store.listen(emit(snapshotRef, onChange));
|
|
336
|
+
}, deps);
|
|
337
|
+
let get = () => snapshotRef.current;
|
|
338
|
+
let server = get;
|
|
339
|
+
if (ssr && "init" in store) server = ssr === "initial" ? () => store.init : ssr;
|
|
340
|
+
return useSyncExternalStore(subscribe, get, server);
|
|
336
341
|
}
|
|
337
342
|
//#endregion
|
|
338
343
|
//#region ../diagram/src/hooks/safeContext.tsx
|
|
339
|
-
var
|
|
340
|
-
|
|
341
|
-
var
|
|
344
|
+
var DiagramApiSafeContext = createContext(null);
|
|
345
|
+
DiagramApiSafeContext.displayName = "DiagramApiSafeContext";
|
|
346
|
+
var DiagramApiContextProvider = DiagramApiSafeContext.Provider;
|
|
342
347
|
function useDiagram() {
|
|
343
|
-
|
|
344
|
-
if (
|
|
345
|
-
return
|
|
348
|
+
const ctx = use(DiagramApiSafeContext);
|
|
349
|
+
if (ctx === null) throw new Error("DiagramApi is not provided");
|
|
350
|
+
return ctx;
|
|
346
351
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
352
|
+
/**
|
|
353
|
+
* Helper to create a safe context for an actor
|
|
354
|
+
* @example
|
|
355
|
+
* ```tsx
|
|
356
|
+
* const {
|
|
357
|
+
* ContextProvider: MyActorContext,
|
|
358
|
+
* useActorRef,
|
|
359
|
+
* selectSnapshot,
|
|
360
|
+
* useActorSelector
|
|
361
|
+
* } = createSafeContextForActor<MyActorRef>()
|
|
362
|
+
*
|
|
363
|
+
* const select = selectSnapshot(
|
|
364
|
+
* s => ....,
|
|
365
|
+
* (a, b) => a === b
|
|
366
|
+
* )
|
|
367
|
+
*
|
|
368
|
+
* // Later in component:
|
|
369
|
+
* const value = useActorSelector(select)
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
function createSafeContextForActor(name) {
|
|
373
|
+
const Ctx = createContext(null);
|
|
374
|
+
function selectSnapshot(selector, compare) {
|
|
375
|
+
return [selector, compare ?? shallowEqual];
|
|
351
376
|
}
|
|
352
|
-
function selectContext(
|
|
353
|
-
return [(
|
|
377
|
+
function selectContext(selector, compare) {
|
|
378
|
+
return [(snapshot) => selector(snapshot.context), compare ?? shallowEqual];
|
|
354
379
|
}
|
|
355
380
|
function useActorRef() {
|
|
356
|
-
|
|
357
|
-
if (
|
|
358
|
-
return
|
|
381
|
+
const actorRef = useContext(Ctx);
|
|
382
|
+
if (actorRef === null) throw new Error(`${name}SafeContext is not provided `);
|
|
383
|
+
return actorRef;
|
|
359
384
|
}
|
|
360
|
-
function useActorSelector(
|
|
361
|
-
let
|
|
362
|
-
|
|
385
|
+
function useActorSelector(arg1, arg2) {
|
|
386
|
+
let selector;
|
|
387
|
+
let compare;
|
|
388
|
+
if (arg2 !== void 0) [selector, compare] = [arg1, arg2];
|
|
389
|
+
else if (Array.isArray(arg1)) [selector, compare] = arg1;
|
|
390
|
+
else {
|
|
391
|
+
selector = arg1;
|
|
392
|
+
compare = shallowEqual;
|
|
393
|
+
}
|
|
394
|
+
compare ??= shallowEqual;
|
|
395
|
+
invariant(e(selector), "selector must be a function");
|
|
396
|
+
return useSelector(useActorRef(), selector, compare);
|
|
363
397
|
}
|
|
364
398
|
return {
|
|
365
|
-
ContextProvider:
|
|
399
|
+
ContextProvider: Ctx.Provider,
|
|
366
400
|
selectSnapshot,
|
|
367
401
|
selectContext,
|
|
368
402
|
useActorSelector,
|
|
369
403
|
useActorRef
|
|
370
404
|
};
|
|
371
405
|
}
|
|
372
|
-
var { ContextProvider:
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
let
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
let
|
|
386
|
-
|
|
387
|
-
uselikec4palette:
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
406
|
+
var { ContextProvider: DiagramActorContextProvider, selectSnapshot: selectDiagramSnapshot, selectContext: selectDiagramContext, useActorSelector: useDiagramSelector, useActorRef: useDiagramActorRef } = createSafeContextForActor("DiagramActor");
|
|
407
|
+
//#endregion
|
|
408
|
+
//#region ../diagram/src/base-primitives/Markdown.tsx
|
|
409
|
+
var Markdown = forwardRef((t0, ref) => {
|
|
410
|
+
const $ = c(34);
|
|
411
|
+
let className;
|
|
412
|
+
let fontSize;
|
|
413
|
+
let props;
|
|
414
|
+
let style;
|
|
415
|
+
let t1;
|
|
416
|
+
let t2;
|
|
417
|
+
let t3;
|
|
418
|
+
let t4;
|
|
419
|
+
let value;
|
|
420
|
+
if ($[0] !== t0) {
|
|
421
|
+
({value, textScale: t1, uselikec4palette: t2, hideIfEmpty: t3, emptyText: t4, className, style, fontSize, ...props} = t0);
|
|
422
|
+
$[0] = t0;
|
|
423
|
+
$[1] = className;
|
|
424
|
+
$[2] = fontSize;
|
|
425
|
+
$[3] = props;
|
|
426
|
+
$[4] = style;
|
|
427
|
+
$[5] = t1;
|
|
428
|
+
$[6] = t2;
|
|
429
|
+
$[7] = t3;
|
|
430
|
+
$[8] = t4;
|
|
431
|
+
$[9] = value;
|
|
432
|
+
} else {
|
|
433
|
+
className = $[1];
|
|
434
|
+
fontSize = $[2];
|
|
435
|
+
props = $[3];
|
|
436
|
+
style = $[4];
|
|
437
|
+
t1 = $[5];
|
|
438
|
+
t2 = $[6];
|
|
439
|
+
t3 = $[7];
|
|
440
|
+
t4 = $[8];
|
|
441
|
+
value = $[9];
|
|
442
|
+
}
|
|
443
|
+
const textScale = t1 === void 0 ? 1 : t1;
|
|
444
|
+
const uselikec4palette = t2 === void 0 ? false : t2;
|
|
445
|
+
const hideIfEmpty = t3 === void 0 ? false : t3;
|
|
446
|
+
const emptyText = t4 === void 0 ? "no content" : t4;
|
|
447
|
+
if (value.isEmpty && hideIfEmpty) return null;
|
|
448
|
+
let t5;
|
|
449
|
+
if ($[10] !== emptyText || $[11] !== value.html || $[12] !== value.isMarkdown || $[13] !== value.nonEmpty || $[14] !== value.text) {
|
|
450
|
+
t5 = value.nonEmpty ? value.isMarkdown ? { dangerouslySetInnerHTML: { __html: value.html } } : { children: /* @__PURE__ */ jsx("p", { children: value.text }) } : { children: /* @__PURE__ */ jsx(Text, {
|
|
451
|
+
component: "span",
|
|
452
|
+
fz: "xs",
|
|
453
|
+
c: "dimmed",
|
|
454
|
+
style: { userSelect: "none" },
|
|
455
|
+
children: emptyText
|
|
456
|
+
}) };
|
|
457
|
+
$[10] = emptyText;
|
|
458
|
+
$[11] = value.html;
|
|
459
|
+
$[12] = value.isMarkdown;
|
|
460
|
+
$[13] = value.nonEmpty;
|
|
461
|
+
$[14] = value.text;
|
|
462
|
+
$[15] = t5;
|
|
463
|
+
} else t5 = $[15];
|
|
464
|
+
const content = t5;
|
|
465
|
+
let t6;
|
|
466
|
+
if ($[16] !== className || $[17] !== uselikec4palette || $[18] !== value.isMarkdown) {
|
|
467
|
+
t6 = cx(markdownBlock({
|
|
468
|
+
uselikec4palette,
|
|
469
|
+
value: value.isMarkdown ? "markdown" : "plaintext"
|
|
470
|
+
}), className);
|
|
471
|
+
$[16] = className;
|
|
472
|
+
$[17] = uselikec4palette;
|
|
473
|
+
$[18] = value.isMarkdown;
|
|
474
|
+
$[19] = t6;
|
|
475
|
+
} else t6 = $[19];
|
|
476
|
+
let t7;
|
|
477
|
+
if ($[20] !== fontSize) {
|
|
478
|
+
t7 = fontSize && { "--text-fz": `var(--font-sizes-${fontSize}, var(--font-sizes-md))` };
|
|
479
|
+
$[20] = fontSize;
|
|
480
|
+
$[21] = t7;
|
|
481
|
+
} else t7 = $[21];
|
|
482
|
+
let t8;
|
|
483
|
+
if ($[22] !== textScale) {
|
|
484
|
+
t8 = textScale !== 1 && { "--mantine-scale": textScale };
|
|
485
|
+
$[22] = textScale;
|
|
486
|
+
$[23] = t8;
|
|
487
|
+
} else t8 = $[23];
|
|
488
|
+
let t9;
|
|
489
|
+
if ($[24] !== style || $[25] !== t7 || $[26] !== t8) {
|
|
490
|
+
t9 = {
|
|
491
|
+
...style,
|
|
492
|
+
...t7,
|
|
493
|
+
...t8
|
|
494
|
+
};
|
|
495
|
+
$[24] = style;
|
|
496
|
+
$[25] = t7;
|
|
497
|
+
$[26] = t8;
|
|
498
|
+
$[27] = t9;
|
|
499
|
+
} else t9 = $[27];
|
|
500
|
+
let t10;
|
|
501
|
+
if ($[28] !== content || $[29] !== props || $[30] !== ref || $[31] !== t6 || $[32] !== t9) {
|
|
502
|
+
t10 = /* @__PURE__ */ jsx(Box, {
|
|
503
|
+
...props,
|
|
504
|
+
ref,
|
|
505
|
+
className: t6,
|
|
506
|
+
style: t9,
|
|
507
|
+
...content
|
|
508
|
+
});
|
|
509
|
+
$[28] = content;
|
|
510
|
+
$[29] = props;
|
|
511
|
+
$[30] = ref;
|
|
512
|
+
$[31] = t6;
|
|
513
|
+
$[32] = t9;
|
|
514
|
+
$[33] = t10;
|
|
515
|
+
} else t10 = $[33];
|
|
516
|
+
return t10;
|
|
408
517
|
});
|
|
409
|
-
|
|
518
|
+
Markdown.displayName = "Markdown";
|
|
410
519
|
//#endregion
|
|
411
520
|
//#region src/context/safeCtx.ts
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
521
|
+
/**
|
|
522
|
+
* To improve experience with HMR, we move context to separate files and use as a boundary for hooks
|
|
523
|
+
*/
|
|
524
|
+
var LikeC4ModelDataContext = createContext(null);
|
|
525
|
+
var LikeC4ModelDataContextProvider = LikeC4ModelDataContext.Provider;
|
|
526
|
+
var useLikeC4ModelAtom = () => {
|
|
527
|
+
const ctx = useContext(LikeC4ModelDataContext);
|
|
528
|
+
if (ctx === null) throw new Error("LikeC4ModelAtom is not provided");
|
|
529
|
+
return ctx;
|
|
416
530
|
};
|
|
417
531
|
//#endregion
|
|
418
532
|
//#region src/hooks.ts
|
|
419
|
-
function useTransparentBackground(
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
533
|
+
function useTransparentBackground(t0) {
|
|
534
|
+
const $ = c(3);
|
|
535
|
+
const enabled = t0 === void 0 ? true : t0;
|
|
536
|
+
let t1;
|
|
537
|
+
let t2;
|
|
538
|
+
if ($[0] !== enabled) {
|
|
539
|
+
t1 = () => {
|
|
540
|
+
const htmlEl = document.body.parentElement;
|
|
541
|
+
if (!htmlEl || enabled !== true) return;
|
|
542
|
+
htmlEl.classList.add("transparent-bg");
|
|
543
|
+
return () => {
|
|
544
|
+
htmlEl.classList.remove("transparent-bg");
|
|
545
|
+
};
|
|
425
546
|
};
|
|
426
|
-
|
|
547
|
+
t2 = [enabled];
|
|
548
|
+
$[0] = enabled;
|
|
549
|
+
$[1] = t1;
|
|
550
|
+
$[2] = t2;
|
|
551
|
+
} else {
|
|
552
|
+
t1 = $[1];
|
|
553
|
+
t2 = $[2];
|
|
554
|
+
}
|
|
555
|
+
useIsomorphicLayoutEffect(t1, t2);
|
|
427
556
|
}
|
|
428
557
|
function useLikeC4Views() {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
let
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
558
|
+
const $ = c(4);
|
|
559
|
+
const $likec4model = useLikeC4ModelAtom();
|
|
560
|
+
let t0;
|
|
561
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
562
|
+
t0 = [];
|
|
563
|
+
$[0] = t0;
|
|
564
|
+
} else t0 = $[0];
|
|
565
|
+
const [views, setViews] = useState(t0);
|
|
566
|
+
let t1;
|
|
567
|
+
let t2;
|
|
568
|
+
if ($[1] !== $likec4model) {
|
|
569
|
+
t1 = () => $likec4model.subscribe((next) => {
|
|
570
|
+
setViews((prev) => {
|
|
571
|
+
const nextViews = [...next.views()].map((v) => {
|
|
572
|
+
const n = v.$layouted;
|
|
573
|
+
const p = prev.find((_) => _.id === v.id);
|
|
574
|
+
return !!p && deepEqual(n, p) ? p : n;
|
|
575
|
+
});
|
|
576
|
+
if (shallowEqual(prev, nextViews)) return prev;
|
|
577
|
+
return nextViews;
|
|
437
578
|
});
|
|
438
|
-
return p(s, c) ? s : c;
|
|
439
579
|
});
|
|
440
|
-
|
|
580
|
+
t2 = [$likec4model];
|
|
581
|
+
$[1] = $likec4model;
|
|
582
|
+
$[2] = t1;
|
|
583
|
+
$[3] = t2;
|
|
584
|
+
} else {
|
|
585
|
+
t1 = $[2];
|
|
586
|
+
t2 = $[3];
|
|
587
|
+
}
|
|
588
|
+
useEffect(t1, t2);
|
|
589
|
+
return views;
|
|
441
590
|
}
|
|
442
591
|
function useCurrentViewId() {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
592
|
+
const $ = c(1);
|
|
593
|
+
let t0;
|
|
594
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
595
|
+
t0 = {
|
|
596
|
+
select: _temp,
|
|
597
|
+
strict: false
|
|
598
|
+
};
|
|
599
|
+
$[0] = t0;
|
|
600
|
+
} else t0 = $[0];
|
|
601
|
+
return useParams(t0) ?? "index";
|
|
448
602
|
}
|
|
449
|
-
function _temp(
|
|
450
|
-
return
|
|
603
|
+
function _temp(params) {
|
|
604
|
+
return params.viewId;
|
|
451
605
|
}
|
|
606
|
+
/**
|
|
607
|
+
* Returns the current view and a function to set the layout type.
|
|
608
|
+
*/
|
|
452
609
|
function useCurrentView() {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
let
|
|
458
|
-
|
|
610
|
+
const $ = c(13);
|
|
611
|
+
const viewId = useCurrentViewId();
|
|
612
|
+
const $likec4model = useLikeC4ModelAtom();
|
|
613
|
+
const [layoutType, setLayoutType] = useState("manual");
|
|
614
|
+
let t0;
|
|
615
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
616
|
+
t0 = () => {
|
|
617
|
+
setLayoutType("manual");
|
|
618
|
+
};
|
|
619
|
+
$[0] = t0;
|
|
620
|
+
} else t0 = $[0];
|
|
621
|
+
let t1;
|
|
622
|
+
if ($[1] !== viewId) {
|
|
623
|
+
t1 = [viewId];
|
|
624
|
+
$[1] = viewId;
|
|
625
|
+
$[2] = t1;
|
|
626
|
+
} else t1 = $[2];
|
|
627
|
+
useUpdateEffect(t0, t1);
|
|
459
628
|
let t2;
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
629
|
+
if ($[3] !== $likec4model || $[4] !== viewId) {
|
|
630
|
+
t2 = () => $likec4model.get().findView(viewId)?.$layouted ?? null;
|
|
631
|
+
$[3] = $likec4model;
|
|
632
|
+
$[4] = viewId;
|
|
633
|
+
$[5] = t2;
|
|
634
|
+
} else t2 = $[5];
|
|
635
|
+
const [view, setView] = useState(t2);
|
|
636
|
+
let t3;
|
|
637
|
+
let t4;
|
|
638
|
+
if ($[6] !== $likec4model || $[7] !== layoutType || $[8] !== viewId) {
|
|
639
|
+
t3 = () => $likec4model.subscribe((next, old) => {
|
|
640
|
+
setView((current) => {
|
|
641
|
+
const vm = next.findView(viewId);
|
|
642
|
+
if (!vm) return current?.id === viewId ? current : null;
|
|
643
|
+
const nextView = layoutType === "auto" ? vm.$view : vm.$layouted;
|
|
644
|
+
if (deepEqual(current, nextView)) return current;
|
|
645
|
+
return nextView;
|
|
646
|
+
});
|
|
468
647
|
});
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
648
|
+
t4 = [
|
|
649
|
+
$likec4model,
|
|
650
|
+
viewId,
|
|
651
|
+
layoutType
|
|
652
|
+
];
|
|
653
|
+
$[6] = $likec4model;
|
|
654
|
+
$[7] = layoutType;
|
|
655
|
+
$[8] = viewId;
|
|
656
|
+
$[9] = t3;
|
|
657
|
+
$[10] = t4;
|
|
658
|
+
} else {
|
|
659
|
+
t3 = $[9];
|
|
660
|
+
t4 = $[10];
|
|
661
|
+
}
|
|
662
|
+
useEffect(t3, t4);
|
|
663
|
+
let t5;
|
|
664
|
+
if ($[11] !== view) {
|
|
665
|
+
t5 = [view, setLayoutType];
|
|
666
|
+
$[11] = view;
|
|
667
|
+
$[12] = t5;
|
|
668
|
+
} else t5 = $[12];
|
|
669
|
+
return t5;
|
|
476
670
|
}
|
|
477
671
|
function useCurrentProject() {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
let
|
|
481
|
-
|
|
672
|
+
const $ = c(4);
|
|
673
|
+
const projects = useLikeC4Projects();
|
|
674
|
+
let t0;
|
|
675
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
676
|
+
t0 = {
|
|
677
|
+
select: selectProjectIdFromContext,
|
|
678
|
+
structuralSharing: false
|
|
679
|
+
};
|
|
680
|
+
$[0] = t0;
|
|
681
|
+
} else t0 = $[0];
|
|
682
|
+
const projectId = useMatches(t0);
|
|
683
|
+
let t1;
|
|
684
|
+
if ($[1] !== projectId || $[2] !== projects) {
|
|
685
|
+
t1 = projectId && projects.find((p) => p.id === projectId) || projects[0];
|
|
686
|
+
$[1] = projectId;
|
|
687
|
+
$[2] = projects;
|
|
688
|
+
$[3] = t1;
|
|
689
|
+
} else t1 = $[3];
|
|
690
|
+
return t1;
|
|
482
691
|
}
|
|
483
|
-
function selectProjectIdFromContext(
|
|
484
|
-
return
|
|
692
|
+
function selectProjectIdFromContext(matches) {
|
|
693
|
+
return matches.find((m) => m.routeId === "/project/$projectId")?.params?.projectId ?? matches.at(-1)?.context.projectId ?? void 0;
|
|
485
694
|
}
|
|
486
695
|
//#endregion
|
|
487
|
-
export {
|
|
696
|
+
export { r$1 as A, noop$1 as C, createReactComponent as D, IconSparkles as E, t$3 as F, e$2 as I, t$1 as M, r$3 as N, t as O, t$2 as P, isBrowser as S, IconPlayerStopFilled as T, useStore as _, useTransparentBackground as a, useTimeoutEffect as b, Markdown as c, createSafeContextForActor as d, selectDiagramContext as f, useDiagramSelector as g, useDiagramActorRef as h, useLikeC4Views as i, e$1 as j, e as k, DiagramActorContextProvider as l, useDiagram as m, useCurrentView as n, LikeC4ModelDataContextProvider as o, selectDiagramSnapshot as p, useCurrentViewId as r, useLikeC4ModelAtom as s, useCurrentProject as t, DiagramApiContextProvider as u, depsShallowEqual as v, useSyncedRef as w, useFirstMountState as x, useUpdateEffect as y };
|