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,119 +1,139 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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,352 +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.2/node_modules/nanostores/atom/index.js
|
|
223
|
-
var B = [], V = 0, H = null, U = 4, W = globalThis.nanostoresGlobal ||= { epoch: 0 }, drainQueue = () => {
|
|
224
|
-
let o;
|
|
225
|
-
for (V = 0; V < B.length; V += U) try {
|
|
226
|
-
B[V](B[V + 1].value, B[V + 2], B[V + 3]);
|
|
227
|
-
} catch (s) {
|
|
228
|
-
o = s;
|
|
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;
|
|
229
317
|
}
|
|
230
|
-
|
|
231
|
-
}, atom = /* @__NO_SIDE_EFFECTS__ */ (o) => {
|
|
232
|
-
let s = [], c = {
|
|
233
|
-
eq: Object.is,
|
|
234
|
-
get() {
|
|
235
|
-
return c.lc || c.listen(() => {})(), c.value;
|
|
236
|
-
},
|
|
237
|
-
init: o,
|
|
238
|
-
lc: 0,
|
|
239
|
-
listen(o) {
|
|
240
|
-
return c.lc = s.push(o), () => {
|
|
241
|
-
for (let s = V + U; s < B.length;) B[s] === o ? B.splice(s, U) : s += U;
|
|
242
|
-
let l = s.indexOf(o);
|
|
243
|
-
~l && (s.splice(l, 1), --c.lc || c.off());
|
|
244
|
-
};
|
|
245
|
-
},
|
|
246
|
-
notify(o, l) {
|
|
247
|
-
W.epoch++;
|
|
248
|
-
let u = !B.length && !0;
|
|
249
|
-
for (let u of s) H?.has(u) || (H?.add(u), B.push(u, c, o, l));
|
|
250
|
-
u && drainQueue();
|
|
251
|
-
},
|
|
252
|
-
off() {},
|
|
253
|
-
set(o) {
|
|
254
|
-
let s = c.value;
|
|
255
|
-
c.eq(s, o) || (c.value = o, c.notify(s));
|
|
256
|
-
},
|
|
257
|
-
subscribe(o) {
|
|
258
|
-
let s = c.listen(o);
|
|
259
|
-
return o(c.value), s;
|
|
260
|
-
},
|
|
261
|
-
value: o
|
|
262
|
-
};
|
|
263
|
-
return c;
|
|
264
|
-
}, G = 5, K = 6, q = 10, on = (o, s, c, l) => (o.events = o.events || {}, o.events[c + q] || (o.events[c + q] = l((s) => {
|
|
265
|
-
o.events[c].reduceRight((o, s) => (s(o), o), {
|
|
266
|
-
shared: {},
|
|
267
|
-
...s
|
|
268
|
-
});
|
|
269
|
-
})), o.events[c] = o.events[c] || [], o.events[c].push(s), () => {
|
|
270
|
-
let l = o.events[c], u = l.indexOf(s);
|
|
271
|
-
l.splice(u, 1), l.length || (delete o.events[c], o.events[c + q](), delete o.events[c + q]);
|
|
272
|
-
}), J = 1e3, onMount = (o, s) => {
|
|
273
|
-
let listener = (c) => {
|
|
274
|
-
let l = s(c);
|
|
275
|
-
l && o.events[K].push(l);
|
|
276
|
-
};
|
|
277
|
-
return on(o, listener, G, (s) => {
|
|
278
|
-
let c = o.listen;
|
|
279
|
-
o.listen = (...l) => (!o.lc && !o.active && (o.active = !0, s()), c(...l));
|
|
280
|
-
let l = o.off;
|
|
281
|
-
return o.events[K] = [], o.off = () => {
|
|
282
|
-
l(), setTimeout(() => {
|
|
283
|
-
if (o.active && !o.lc) {
|
|
284
|
-
o.active = !1;
|
|
285
|
-
for (let s of o.events[K]) s();
|
|
286
|
-
o.events[K] = [];
|
|
287
|
-
}
|
|
288
|
-
}, J);
|
|
289
|
-
}, () => {
|
|
290
|
-
o.listen = c, o.off = l;
|
|
291
|
-
};
|
|
292
|
-
});
|
|
318
|
+
return true;
|
|
293
319
|
};
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
function getPath(o, s) {
|
|
297
|
-
let c = getAllKeysFromPath(s), l = o;
|
|
298
|
-
for (let o of c) {
|
|
299
|
-
if (l == null) return;
|
|
300
|
-
l = l[o];
|
|
301
|
-
}
|
|
302
|
-
return l;
|
|
303
|
-
}
|
|
304
|
-
var Y = /(.*)\[(\d+)\]/;
|
|
305
|
-
function getAllKeysFromPath(o) {
|
|
306
|
-
return o.split(".").flatMap((o) => getKeyAndIndicesFromKey(o));
|
|
307
|
-
}
|
|
308
|
-
function getKeyAndIndicesFromKey(o) {
|
|
309
|
-
if (Y.test(o)) {
|
|
310
|
-
let [, s, c] = o.match(Y);
|
|
311
|
-
return [...getKeyAndIndicesFromKey(s), c];
|
|
312
|
-
}
|
|
313
|
-
return [o];
|
|
320
|
+
function useUpdateEffect(callback, deps, equalityFn, effectHook) {
|
|
321
|
+
useCustomCompareEffect(useFirstMountState() ? noop : callback, deps, equalityFn ?? depsShallowEqual, effectHook);
|
|
314
322
|
}
|
|
315
323
|
//#endregion
|
|
316
|
-
//#region ../../node_modules/.pnpm
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
//#endregion
|
|
324
|
-
//#region ../../node_modules/.pnpm/@nanostores+react@1.1.0_nanostores@1.5.2_react@19.2.8/node_modules/@nanostores/react/index.js
|
|
325
|
-
var emit = (o, s) => (c) => {
|
|
326
|
-
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();
|
|
327
329
|
};
|
|
328
|
-
function useStore(
|
|
329
|
-
let
|
|
330
|
-
|
|
331
|
-
let
|
|
332
|
-
|
|
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);
|
|
333
341
|
}
|
|
334
342
|
//#endregion
|
|
335
343
|
//#region ../diagram/src/hooks/safeContext.tsx
|
|
336
|
-
var
|
|
337
|
-
|
|
338
|
-
var
|
|
344
|
+
var DiagramApiSafeContext = createContext(null);
|
|
345
|
+
DiagramApiSafeContext.displayName = "DiagramApiSafeContext";
|
|
346
|
+
var DiagramApiContextProvider = DiagramApiSafeContext.Provider;
|
|
339
347
|
function useDiagram() {
|
|
340
|
-
|
|
341
|
-
if (
|
|
342
|
-
return
|
|
348
|
+
const ctx = use(DiagramApiSafeContext);
|
|
349
|
+
if (ctx === null) throw new Error("DiagramApi is not provided");
|
|
350
|
+
return ctx;
|
|
343
351
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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];
|
|
348
376
|
}
|
|
349
|
-
function selectContext(
|
|
350
|
-
return [(
|
|
377
|
+
function selectContext(selector, compare) {
|
|
378
|
+
return [(snapshot) => selector(snapshot.context), compare ?? shallowEqual];
|
|
351
379
|
}
|
|
352
380
|
function useActorRef() {
|
|
353
|
-
|
|
354
|
-
if (
|
|
355
|
-
return
|
|
381
|
+
const actorRef = useContext(Ctx);
|
|
382
|
+
if (actorRef === null) throw new Error(`${name}SafeContext is not provided `);
|
|
383
|
+
return actorRef;
|
|
356
384
|
}
|
|
357
|
-
function useActorSelector(
|
|
358
|
-
let
|
|
359
|
-
|
|
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);
|
|
360
397
|
}
|
|
361
398
|
return {
|
|
362
|
-
ContextProvider:
|
|
399
|
+
ContextProvider: Ctx.Provider,
|
|
363
400
|
selectSnapshot,
|
|
364
401
|
selectContext,
|
|
365
402
|
useActorSelector,
|
|
366
403
|
useActorRef
|
|
367
404
|
};
|
|
368
405
|
}
|
|
369
|
-
var { ContextProvider:
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
let
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
let
|
|
383
|
-
|
|
384
|
-
uselikec4palette:
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
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;
|
|
405
517
|
});
|
|
406
|
-
|
|
518
|
+
Markdown.displayName = "Markdown";
|
|
407
519
|
//#endregion
|
|
408
520
|
//#region src/context/safeCtx.ts
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
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;
|
|
413
530
|
};
|
|
414
531
|
//#endregion
|
|
415
532
|
//#region src/hooks.ts
|
|
416
|
-
function useTransparentBackground(
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
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
|
+
};
|
|
422
546
|
};
|
|
423
|
-
|
|
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);
|
|
424
556
|
}
|
|
425
557
|
function useLikeC4Views() {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
let
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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;
|
|
434
578
|
});
|
|
435
|
-
return p(s, c) ? s : c;
|
|
436
579
|
});
|
|
437
|
-
|
|
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;
|
|
438
590
|
}
|
|
439
591
|
function useCurrentViewId() {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
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";
|
|
445
602
|
}
|
|
446
|
-
function _temp(
|
|
447
|
-
return
|
|
603
|
+
function _temp(params) {
|
|
604
|
+
return params.viewId;
|
|
448
605
|
}
|
|
606
|
+
/**
|
|
607
|
+
* Returns the current view and a function to set the layout type.
|
|
608
|
+
*/
|
|
449
609
|
function useCurrentView() {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
let
|
|
455
|
-
|
|
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);
|
|
456
628
|
let t2;
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
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
|
+
});
|
|
465
647
|
});
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
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;
|
|
473
670
|
}
|
|
474
671
|
function useCurrentProject() {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
let
|
|
478
|
-
|
|
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;
|
|
479
691
|
}
|
|
480
|
-
function selectProjectIdFromContext(
|
|
481
|
-
return
|
|
692
|
+
function selectProjectIdFromContext(matches) {
|
|
693
|
+
return matches.find((m) => m.routeId === "/project/$projectId")?.params?.projectId ?? matches.at(-1)?.context.projectId ?? void 0;
|
|
482
694
|
}
|
|
483
695
|
//#endregion
|
|
484
|
-
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 };
|