likec4 1.34.2 → 1.36.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__/src/main.js +13096 -9900
- package/__app__/src/style.css +1 -1
- package/dist/cli/index.mjs +277 -276
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/shared/{likec4.C6HFkgux.d.mts → likec4.CoVNuZKl.d.mts} +46 -23
- package/dist/shared/likec4.D8qlxD_Y.mjs +239 -0
- package/dist/shared/{likec4.B5b4pT-B.mjs → likec4.DWIqzE5d.mjs} +1891 -1884
- package/dist/vite-plugin/index.d.mts +2 -2
- package/dist/vite-plugin/index.mjs +1 -1
- package/package.json +31 -30
- package/react/index.d.mts +221 -30
- package/react/index.mjs +77 -63
- package/vite-plugin-modules.d.ts +2 -1
- package/dist/shared/likec4.ButMg-j9.mjs +0 -239
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { L as LikeC4LanguageServices } from '../shared/likec4.
|
|
1
|
+
import { L as LikeC4LanguageServices } from '../shared/likec4.CoVNuZKl.mjs';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
import '@likec4/core';
|
|
4
4
|
import '@likec4/core/model';
|
|
5
|
-
import '/home/runner/work/likec4/likec4/node_modules/.pnpm/@types+picomatch@4.0.
|
|
5
|
+
import '/home/runner/work/likec4/likec4/node_modules/.pnpm/@types+picomatch@4.0.2/node_modules/@types/picomatch/posix.d.ts';
|
|
6
6
|
import '@likec4/core/types';
|
|
7
7
|
import '@likec4/core/utils';
|
|
8
8
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{L as LikeC4VitePlugin}from"../shared/likec4.
|
|
1
|
+
export{L as LikeC4VitePlugin}from"../shared/likec4.D8qlxD_Y.mjs";import"@likec4/core";import"node:path";import"../shared/likec4.DWIqzE5d.mjs";import"node:fs";import"node:url";import"../shared/likec4.BeWJWU7_.mjs";import"tty";import"node:util";import"util";import"path";import"os";import"crypto";import"net";import"url";import"fs";import"child_process";import"@likec4/core/types";import"events";import"@hpcc-js/wasm-graphviz";import"@likec4/core/model";import"buffer";import"@likec4/core/compute-view";
|
|
2
2
|
import"@likec4/core/utils";import"node:process";import"boxen";import"node:child_process";import"node:events";import"node:fs/promises";import"node:stream/promises";import"node:readline/promises";import"node:os";import"fs/promises";
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "likec4",
|
|
3
|
-
"
|
|
3
|
+
"description": "Toolchain for your architecture diagrams",
|
|
4
|
+
"version": "1.36.0",
|
|
4
5
|
"license": "MIT",
|
|
5
6
|
"homepage": "https://likec4.dev",
|
|
6
7
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -89,14 +90,14 @@
|
|
|
89
90
|
"access": "public"
|
|
90
91
|
},
|
|
91
92
|
"dependencies": {
|
|
92
|
-
"@hpcc-js/wasm-graphviz": "1.
|
|
93
|
+
"@hpcc-js/wasm-graphviz": "1.10.0",
|
|
93
94
|
"@vitejs/plugin-react": "^4.6.0",
|
|
94
95
|
"boxen": "^8.0.1",
|
|
95
|
-
"playwright": "
|
|
96
|
+
"playwright": "1.54.2",
|
|
96
97
|
"rollup": "^4.44.0",
|
|
97
98
|
"type-fest": "^4.41.0",
|
|
98
99
|
"vite": "^6.3.5",
|
|
99
|
-
"@likec4/core": "1.
|
|
100
|
+
"@likec4/core": "1.36.0"
|
|
100
101
|
},
|
|
101
102
|
"peerDependencies": {
|
|
102
103
|
"react": "^18.x || ^19.x",
|
|
@@ -105,23 +106,23 @@
|
|
|
105
106
|
"devDependencies": {
|
|
106
107
|
"@dagrejs/dagre": "1.1.5",
|
|
107
108
|
"@fontsource/ibm-plex-sans": "^5.2.6",
|
|
108
|
-
"@mantine/core": "8.
|
|
109
|
-
"@mantine/hooks": "8.
|
|
109
|
+
"@mantine/core": "8.2.2",
|
|
110
|
+
"@mantine/hooks": "8.2.2",
|
|
110
111
|
"@nanostores/react": "1.0.0",
|
|
111
112
|
"@pandacss/dev": "^0.54.0",
|
|
112
113
|
"@react-hookz/web": "^25.1.1",
|
|
113
|
-
"@tabler/icons-react": "3.
|
|
114
|
+
"@tabler/icons-react": "3.34.1",
|
|
114
115
|
"@tanstack/react-router": "^1.114.13",
|
|
115
116
|
"@tanstack/router-cli": "^1.114.13",
|
|
116
117
|
"@tanstack/router-vite-plugin": "^1.114.13",
|
|
117
|
-
"@types/node": "~20.19.
|
|
118
|
-
"@types/picomatch": "^4.0.
|
|
119
|
-
"@types/react": "19.1.
|
|
120
|
-
"@types/react-dom": "19.1.
|
|
118
|
+
"@types/node": "~20.19.2",
|
|
119
|
+
"@types/picomatch": "^4.0.2",
|
|
120
|
+
"@types/react": "19.1.9",
|
|
121
|
+
"@types/react-dom": "19.1.7",
|
|
121
122
|
"@types/semver": "^7.7.0",
|
|
122
123
|
"@types/yargs": "^17.0.33",
|
|
123
|
-
"@xyflow/react": "
|
|
124
|
-
"@xyflow/system": "
|
|
124
|
+
"@xyflow/react": "12.6.4",
|
|
125
|
+
"@xyflow/system": "0.0.61",
|
|
125
126
|
"autoprefixer": "^10.4.21",
|
|
126
127
|
"classnames": "^2.5.1",
|
|
127
128
|
"clsx": "^2.1.1",
|
|
@@ -142,18 +143,18 @@
|
|
|
142
143
|
"langium": "3.5.0",
|
|
143
144
|
"merge-error-cause": "^5.0.2",
|
|
144
145
|
"mkdirp": "^3.0.1",
|
|
145
|
-
"motion": "^12.
|
|
146
|
+
"motion": "^12.23.11",
|
|
146
147
|
"nano-spawn": "^1.0.2",
|
|
147
148
|
"nanostores": "1.0.1",
|
|
148
149
|
"npm-run-all2": "^8.0.4",
|
|
149
150
|
"p-limit": "6.2.0",
|
|
150
151
|
"package-manager-detector": "1.3.0",
|
|
151
152
|
"package-up": "^5.0.0",
|
|
152
|
-
"picomatch": "^4.0.
|
|
153
|
+
"picomatch": "^4.0.3",
|
|
153
154
|
"postcss": "8.5.5",
|
|
154
155
|
"pretty-ms": "^9.2.0",
|
|
155
|
-
"react": "^19.1.
|
|
156
|
-
"react-dom": "^19.1.
|
|
156
|
+
"react": "^19.1.1",
|
|
157
|
+
"react-dom": "^19.1.1",
|
|
157
158
|
"react-error-boundary": "^6.0.0",
|
|
158
159
|
"react-resizable-panels": "^3.0.3",
|
|
159
160
|
"react-shadow": "^20.6.0",
|
|
@@ -162,31 +163,31 @@
|
|
|
162
163
|
"std-env": "^3.9.0",
|
|
163
164
|
"strip-indent": "^4.0.0",
|
|
164
165
|
"tinyrainbow": "^2.0.0",
|
|
165
|
-
"tsx": "4.
|
|
166
|
-
"turbo": "2.5.
|
|
167
|
-
"typescript": "5.
|
|
166
|
+
"tsx": "4.20.3",
|
|
167
|
+
"turbo": "2.5.5",
|
|
168
|
+
"typescript": "5.9.2",
|
|
168
169
|
"ufo": "1.6.1",
|
|
169
170
|
"unbuild": "3.5.0",
|
|
170
171
|
"vite-plugin-dts": "^4.5.4",
|
|
171
172
|
"vite-plugin-inspect": "^11.1.0",
|
|
172
173
|
"vite-plugin-singlefile": "^2.2.0",
|
|
173
174
|
"vitest": "3.2.4",
|
|
174
|
-
"vscode-jsonrpc": "8.2.
|
|
175
|
+
"vscode-jsonrpc": "8.2.1",
|
|
175
176
|
"vscode-languageserver": "9.0.1",
|
|
176
177
|
"vscode-languageserver-types": "3.17.5",
|
|
177
178
|
"vscode-uri": "3.1.0",
|
|
178
179
|
"which": "^5.0.0",
|
|
179
180
|
"wireit": "0.14.12",
|
|
180
181
|
"yargs": "17.7.2",
|
|
181
|
-
"@likec4/diagram": "1.
|
|
182
|
-
"@likec4/icons": "1.
|
|
183
|
-
"@likec4/
|
|
184
|
-
"@likec4/
|
|
185
|
-
"@likec4/
|
|
186
|
-
"@likec4/log": "1.
|
|
187
|
-
"@likec4/
|
|
188
|
-
"@likec4/
|
|
189
|
-
"@likec4/tsconfig": "1.
|
|
182
|
+
"@likec4/diagram": "1.36.0",
|
|
183
|
+
"@likec4/icons": "1.36.0",
|
|
184
|
+
"@likec4/language-server": "1.36.0",
|
|
185
|
+
"@likec4/layouts": "1.36.0",
|
|
186
|
+
"@likec4/generators": "1.36.0",
|
|
187
|
+
"@likec4/log": "1.36.0",
|
|
188
|
+
"@likec4/style-preset": "1.36.0",
|
|
189
|
+
"@likec4/styles": "1.36.0",
|
|
190
|
+
"@likec4/tsconfig": "1.36.0"
|
|
190
191
|
},
|
|
191
192
|
"scripts": {
|
|
192
193
|
"typecheck": "tsc --build --verbose",
|
package/react/index.d.mts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { CSSProperties, ComponentType, HTMLAttributes, JSX, MouseEvent as ReactMouseEvent, PropsWithChildren, ReactNode, WheelEvent as WheelEvent$1 } from 'react';
|
|
4
4
|
|
|
5
|
+
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
5
6
|
type UnionToIntersection<Union> = (
|
|
6
7
|
// `extends unknown` is always going to be the case and is used to convert the
|
|
7
8
|
// `Union` into a [distributive conditional
|
|
@@ -28,6 +29,38 @@ type IsArrayReadonly<T extends UnknownArray> = IfNever<T, false, T extends unkno
|
|
|
28
29
|
type IfArrayReadonly<T extends UnknownArray, TypeIfArrayReadonly = true, TypeIfNotArrayReadonly = false> = IsArrayReadonly<T> extends infer Result ? Result extends true ? TypeIfArrayReadonly : TypeIfNotArrayReadonly : never;
|
|
29
30
|
type NoInfer$1<T> = T extends infer U ? U : never;
|
|
30
31
|
type IsAny<T> = 0 extends 1 & NoInfer$1<T> ? true : false;
|
|
32
|
+
type Numeric = number | bigint;
|
|
33
|
+
type LiteralCheck<T, LiteralType extends Primitive> = (IsNever<T> extends false // Must be wider than `never`
|
|
34
|
+
? [
|
|
35
|
+
T
|
|
36
|
+
] extends [
|
|
37
|
+
LiteralType & infer U
|
|
38
|
+
] // Remove any branding
|
|
39
|
+
? [
|
|
40
|
+
U
|
|
41
|
+
] extends [
|
|
42
|
+
LiteralType
|
|
43
|
+
] // Must be narrower than `LiteralType`
|
|
44
|
+
? [
|
|
45
|
+
LiteralType
|
|
46
|
+
] extends [
|
|
47
|
+
U
|
|
48
|
+
] // Cannot be wider than `LiteralType`
|
|
49
|
+
? false : true : false : false : false);
|
|
50
|
+
type LiteralChecks<T, LiteralUnionType> = (
|
|
51
|
+
// Conditional type to force union distribution.
|
|
52
|
+
// If `T` is none of the literal types in the union `LiteralUnionType`, then `LiteralCheck<T, LiteralType>` will evaluate to `false` for the whole union.
|
|
53
|
+
// If `T` is one of the literal types in the union, it will evaluate to `boolean` (i.e. `true | false`)
|
|
54
|
+
IsNotFalse<LiteralUnionType extends Primitive ? LiteralCheck<T, LiteralUnionType> : never>);
|
|
55
|
+
type IsStringLiteral<T> = IfNever<T, false,
|
|
56
|
+
// If `T` is an infinite string type (e.g., `on${string}`), `Record<T, never>` produces an index signature,
|
|
57
|
+
// and since `{}` extends index signatures, the result becomes `false`.
|
|
58
|
+
T extends string ? {} extends Record<T, never> ? false : true : false>;
|
|
59
|
+
type IsNumericLiteral<T> = LiteralChecks<T, Numeric>;
|
|
60
|
+
type IsBooleanLiteral<T> = LiteralCheck<T, boolean>;
|
|
61
|
+
type IsSymbolLiteral<T> = LiteralCheck<T, symbol>;
|
|
62
|
+
type IsLiteralUnion<T> = IsStringLiteral<T> | IsNumericLiteral<T> | IsBooleanLiteral<T> | IsSymbolLiteral<T>;
|
|
63
|
+
type IsLiteral<T> = IsPrimitive<T> extends true ? IsNotFalse<IsLiteralUnion<T>> : false;
|
|
31
64
|
type IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
32
65
|
type Simplify<T> = {
|
|
33
66
|
[KeyType in keyof T]: T[KeyType];
|
|
@@ -43,6 +76,16 @@ type SimpleMerge<Destination, Source> = {
|
|
|
43
76
|
} & Source;
|
|
44
77
|
type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
45
78
|
type IfAny<T, TypeIfAny = true, TypeIfNotAny = false> = (IsAny<T> extends true ? TypeIfAny : TypeIfNotAny);
|
|
79
|
+
type IsNotFalse<T extends boolean> = [
|
|
80
|
+
T
|
|
81
|
+
] extends [
|
|
82
|
+
false
|
|
83
|
+
] ? false : true;
|
|
84
|
+
type IsPrimitive<T> = [
|
|
85
|
+
T
|
|
86
|
+
] extends [
|
|
87
|
+
Primitive
|
|
88
|
+
] ? true : false;
|
|
46
89
|
type HomomorphicPick<T, Keys extends KeysOfUnion<T>> = {
|
|
47
90
|
[P in keyof T as Extract<P, Keys>]: T[P];
|
|
48
91
|
};
|
|
@@ -120,6 +163,7 @@ interface Link {
|
|
|
120
163
|
relative?: string;
|
|
121
164
|
}
|
|
122
165
|
type Coalesce<V extends string, OrIfAny = string> = IsAny<V> extends true ? OrIfAny : V;
|
|
166
|
+
type ProjectId<T = string> = Tagged<T, "ProjectID">;
|
|
123
167
|
type MarkdownOrString = {
|
|
124
168
|
txt: string;
|
|
125
169
|
md?: never;
|
|
@@ -132,12 +176,16 @@ type Icon = Tagged<string, "Icon"> | BuiltInIcon;
|
|
|
132
176
|
type IconUrl = Icon;
|
|
133
177
|
type Fqn<Id = string> = Tagged<Id, "Fqn">;
|
|
134
178
|
declare function Fqn(name: string, parent?: Fqn | null): Fqn;
|
|
179
|
+
type ElementKind<Kinds = string> = Tagged<Kinds, "ElementKind">;
|
|
135
180
|
type DeploymentFqn<T = string> = Tagged<T, "DeploymentFqn">;
|
|
136
181
|
declare function DeploymentFqn(name: string, parent?: DeploymentFqn | null): DeploymentFqn;
|
|
182
|
+
type DeploymentKind<Kinds = string> = Tagged<Kinds, "DeploymentKind">;
|
|
137
183
|
type ViewId<Id = string> = Tagged<Id, "ViewId">;
|
|
138
184
|
declare function ViewId(id: string): ViewId;
|
|
185
|
+
type RelationshipKind<Kinds = string> = Tagged<Kinds, "RelationshipKind">;
|
|
139
186
|
type RelationId<Id = string> = Tagged<Id, "RelationId">;
|
|
140
187
|
declare function RelationId(id: string): RelationId;
|
|
188
|
+
type Tag$1<T = string> = Tagged<T, "Tag">;
|
|
141
189
|
type NodeId = Tagged<string, "NodeId" | "Fqn" | "DeploymentFqn">;
|
|
142
190
|
declare function NodeId(id: string): NodeId;
|
|
143
191
|
type EdgeId = Tagged<string, "EdgeId">;
|
|
@@ -155,6 +203,7 @@ interface SpecAux<ElementKind extends string, DeploymentKind extends string, Rel
|
|
|
155
203
|
Tag: Tag;
|
|
156
204
|
MetadataKey: MetadataKey;
|
|
157
205
|
}
|
|
206
|
+
type AnySpec = SpecAux<any, any, any, any, any>;
|
|
158
207
|
interface Aux<Stage extends ModelStage, Element extends string, Deployment extends string, View extends string, Project extends string, Spec extends SpecAux<string, string, string, string, string>> {
|
|
159
208
|
Stage: Stage;
|
|
160
209
|
ProjectId: Project;
|
|
@@ -168,26 +217,129 @@ interface Aux<Stage extends ModelStage, Element extends string, Deployment exten
|
|
|
168
217
|
MetadataKey: Spec["MetadataKey"];
|
|
169
218
|
}
|
|
170
219
|
type Any = Aux<any, any, any, any, any, SpecAux<any, any, any, any, any>>;
|
|
220
|
+
type Never = Aux<never, never, never, never, never, SpecAux<never, never, never, never, never>>;
|
|
221
|
+
type Unknown = Aux<"layouted" | "computed", string, string, string, string, SpecAux<string, string, string, string, string>>;
|
|
222
|
+
type UnknownParsed = Aux<"parsed", string, string, string, string, SpecAux<string, string, string, string, string>>;
|
|
223
|
+
type UnknownComputed = Aux<"computed", string, string, string, string, SpecAux<string, string, string, string, string>>;
|
|
171
224
|
type UnknownLayouted = Aux<"layouted", string, string, string, string, SpecAux<string, string, string, string, string>>;
|
|
225
|
+
type Stage<A> = A extends Aux<infer S, any, any, any, any, any> ? IfNever<S, never, Coalesce<S, ModelStage>> : never;
|
|
226
|
+
type PickByStage<A extends Any, OnParsed, OnComputed, OnLayouted = OnComputed> = {
|
|
227
|
+
parsed: OnParsed;
|
|
228
|
+
computed: OnComputed;
|
|
229
|
+
layouted: OnLayouted;
|
|
230
|
+
}[A["Stage"]];
|
|
231
|
+
type setStage<A, S extends ModelStage> = A extends Aux<any, infer E, infer D, infer V, infer P, infer Spec> ? Aux<S, E, D, V, P, Spec> : never;
|
|
232
|
+
type toParsed<A> = A extends Aux<any, infer E, infer D, infer V, infer P, infer Spec> ? Aux<"parsed", E, D, V, P, Spec> : never;
|
|
233
|
+
type toComputed<A> = A extends Aux<any, infer E, infer D, infer V, infer P, infer Spec> ? Aux<"computed", E, D, V, P, Spec> : never;
|
|
234
|
+
type toLayouted<A> = A extends Aux<any, infer E, infer D, infer V, infer P, infer Spec> ? Aux<"layouted", E, D, V, P, Spec> : never;
|
|
235
|
+
type ProjectId$1<A> = A extends infer T extends Any ? Coalesce<T["ProjectId"]> : never;
|
|
236
|
+
type setProject<A, P extends string> = A extends Aux<infer S, infer E, infer D, infer V, any, infer Spec> ? Aux<S, E, D, V, P, Spec> : never;
|
|
172
237
|
type Fqn$1<A> = A extends infer T extends Any ? Fqn<ElementId<T>> : never;
|
|
173
238
|
type ElementId<A> = A extends infer T extends Any ? Coalesce<T["ElementId"]> : never;
|
|
174
239
|
type DeploymentFqn$1<A> = A extends infer T extends Any ? DeploymentFqn<DeploymentId<T>> : never;
|
|
175
240
|
type DeploymentId<A> = A extends infer T extends Any ? Coalesce<T["DeploymentId"]> : never;
|
|
176
241
|
type ViewId$1<A> = A extends infer T extends Any ? Coalesce<T["ViewId"]> : never;
|
|
177
242
|
type RelationId$1 = RelationId;
|
|
178
|
-
type
|
|
179
|
-
type
|
|
243
|
+
type NodeId$1 = NodeId;
|
|
244
|
+
type EdgeId$1 = EdgeId;
|
|
245
|
+
type ElementKind$1<A> = A extends infer T extends Any ? Coalesce<T["ElementKind"]> : never;
|
|
246
|
+
type DeploymentKind$1<A> = A extends infer T extends Any ? Coalesce<T["DeploymentKind"]> : never;
|
|
180
247
|
type RelationKind<A> = A extends infer T extends Any ? Coalesce<T["RelationKind"]> : never;
|
|
181
|
-
type Tag$
|
|
182
|
-
type Tags<A extends Any> = readonly Tag$
|
|
183
|
-
type
|
|
248
|
+
type Tag$2<A> = A extends infer T extends Any ? Coalesce<T["Tag"]> : never;
|
|
249
|
+
type Tags<A extends Any> = readonly Tag$2<A>[];
|
|
250
|
+
type MetadataKey<A> = A extends infer T extends Any ? Coalesce<T["MetadataKey"]> : never;
|
|
251
|
+
type Metadata<A extends Any> = IsNever<A["MetadataKey"]> extends true ? never : IsLiteral<A["MetadataKey"]> extends true ? {
|
|
252
|
+
[key in A["MetadataKey"]]?: string;
|
|
253
|
+
} : Record<string, string>;
|
|
254
|
+
type AllKinds<A> = ElementKind$1<A> | DeploymentKind$1<A> | RelationKind<A>;
|
|
255
|
+
type Spec<A> = A extends Aux<any, any, any, any, any, infer S> ? S : never;
|
|
256
|
+
type StrictProjectId<A> = A extends infer T extends Any ? ProjectId<ProjectId$1<T>> : never;
|
|
184
257
|
type StrictViewId<A> = A extends infer T extends Any ? ViewId<ViewId$1<T>> : never;
|
|
258
|
+
type StrictTag<A> = A extends infer T extends Any ? Tag$1<Tag$2<T>> : never;
|
|
259
|
+
type StrictElementKind<A> = A extends infer T extends Any ? ElementKind<ElementKind$1<T>> : never;
|
|
260
|
+
type StrictDeploymentKind<A> = A extends infer T extends Any ? DeploymentKind<DeploymentKind$1<T>> : never;
|
|
261
|
+
type StrictRelationKind<A> = A extends infer T extends Any ? RelationshipKind<RelationKind<T>> : never;
|
|
262
|
+
type WithTags<A extends Any> = {
|
|
263
|
+
readonly tags: Tags<A>;
|
|
264
|
+
};
|
|
185
265
|
type WithOptionalTags<A extends Any> = {
|
|
186
266
|
readonly tags?: Tags<A> | null;
|
|
187
267
|
};
|
|
268
|
+
type WithLinks = {
|
|
269
|
+
readonly links: readonly Link[];
|
|
270
|
+
};
|
|
188
271
|
type WithOptionalLinks = {
|
|
189
272
|
readonly links?: readonly Link[] | null;
|
|
190
273
|
};
|
|
274
|
+
type WithMetadata<A extends Any> = {
|
|
275
|
+
readonly metadata?: Metadata<A>;
|
|
276
|
+
};
|
|
277
|
+
type OrString = string & Record<never, never>;
|
|
278
|
+
type LooseElementId<A extends Any> = Coalesce<A["ElementId"]> | OrString;
|
|
279
|
+
type LooseDeploymentId<A extends Any> = Coalesce<A["DeploymentId"]> | OrString;
|
|
280
|
+
type LooseViewId<A extends Any> = Coalesce<A["ViewId"]> | OrString;
|
|
281
|
+
type LooseTag<A extends Any> = Coalesce<A["Tag"]> | OrString;
|
|
282
|
+
type LooseTags<A extends Any> = readonly (Coalesce<A["Tag"]> | OrString)[];
|
|
283
|
+
type LooseElementKind<A extends Any> = Coalesce<A["ElementKind"]> | OrString;
|
|
284
|
+
type LooseDeploymentKind<A extends Any> = Coalesce<A["DeploymentKind"]> | OrString;
|
|
285
|
+
type LooseRelationKind<A extends Any> = Coalesce<A["RelationKind"]> | OrString;
|
|
286
|
+
type _aux_AllKinds<A> = AllKinds<A>;
|
|
287
|
+
type _aux_Any = Any;
|
|
288
|
+
type _aux_AnySpec = AnySpec;
|
|
289
|
+
type _aux_Aux<Stage extends ModelStage, Element extends string, Deployment extends string, View extends string, Project extends string, Spec extends SpecAux<string, string, string, string, string>> = Aux<Stage, Element, Deployment, View, Project, Spec>;
|
|
290
|
+
type _aux_DeploymentFqn<A> = DeploymentFqn$1<A>;
|
|
291
|
+
type _aux_DeploymentId<A> = DeploymentId<A>;
|
|
292
|
+
type _aux_DeploymentKind<A> = DeploymentKind$1<A>;
|
|
293
|
+
type _aux_EdgeId = EdgeId$1;
|
|
294
|
+
type _aux_ElementId<A> = ElementId<A>;
|
|
295
|
+
type _aux_ElementKind<A> = ElementKind$1<A>;
|
|
296
|
+
type _aux_Fqn<A> = Fqn$1<A>;
|
|
297
|
+
type _aux_LooseDeploymentId<A extends Any> = LooseDeploymentId<A>;
|
|
298
|
+
type _aux_LooseDeploymentKind<A extends Any> = LooseDeploymentKind<A>;
|
|
299
|
+
type _aux_LooseElementId<A extends Any> = LooseElementId<A>;
|
|
300
|
+
type _aux_LooseElementKind<A extends Any> = LooseElementKind<A>;
|
|
301
|
+
type _aux_LooseRelationKind<A extends Any> = LooseRelationKind<A>;
|
|
302
|
+
type _aux_LooseTag<A extends Any> = LooseTag<A>;
|
|
303
|
+
type _aux_LooseTags<A extends Any> = LooseTags<A>;
|
|
304
|
+
type _aux_LooseViewId<A extends Any> = LooseViewId<A>;
|
|
305
|
+
type _aux_Metadata<A extends Any> = Metadata<A>;
|
|
306
|
+
type _aux_MetadataKey<A> = MetadataKey<A>;
|
|
307
|
+
type _aux_Never = Never;
|
|
308
|
+
type _aux_NodeId = NodeId$1;
|
|
309
|
+
type _aux_OrString = OrString;
|
|
310
|
+
type _aux_PickByStage<A extends Any, OnParsed, OnComputed, OnLayouted = OnComputed> = PickByStage<A, OnParsed, OnComputed, OnLayouted>;
|
|
311
|
+
type _aux_ProjectId<A> = ProjectId$1<A>;
|
|
312
|
+
type _aux_RelationId = RelationId$1;
|
|
313
|
+
type _aux_RelationKind<A> = RelationKind<A>;
|
|
314
|
+
type _aux_Spec<A> = Spec<A>;
|
|
315
|
+
type _aux_SpecAux<ElementKind extends string, DeploymentKind extends string, RelationKind extends string, Tag extends string, MetadataKey extends string> = SpecAux<ElementKind, DeploymentKind, RelationKind, Tag, MetadataKey>;
|
|
316
|
+
type _aux_Stage<A> = Stage<A>;
|
|
317
|
+
type _aux_StrictDeploymentKind<A> = StrictDeploymentKind<A>;
|
|
318
|
+
type _aux_StrictElementKind<A> = StrictElementKind<A>;
|
|
319
|
+
type _aux_StrictProjectId<A> = StrictProjectId<A>;
|
|
320
|
+
type _aux_StrictRelationKind<A> = StrictRelationKind<A>;
|
|
321
|
+
type _aux_StrictTag<A> = StrictTag<A>;
|
|
322
|
+
type _aux_StrictViewId<A> = StrictViewId<A>;
|
|
323
|
+
type _aux_Tag<A> = Tag$2<A>;
|
|
324
|
+
type _aux_Tags<A extends Any> = Tags<A>;
|
|
325
|
+
type _aux_Unknown = Unknown;
|
|
326
|
+
type _aux_UnknownComputed = UnknownComputed;
|
|
327
|
+
type _aux_UnknownLayouted = UnknownLayouted;
|
|
328
|
+
type _aux_UnknownParsed = UnknownParsed;
|
|
329
|
+
type _aux_ViewId<A> = ViewId$1<A>;
|
|
330
|
+
type _aux_WithLinks = WithLinks;
|
|
331
|
+
type _aux_WithMetadata<A extends Any> = WithMetadata<A>;
|
|
332
|
+
type _aux_WithOptionalLinks = WithOptionalLinks;
|
|
333
|
+
type _aux_WithOptionalTags<A extends Any> = WithOptionalTags<A>;
|
|
334
|
+
type _aux_WithTags<A extends Any> = WithTags<A>;
|
|
335
|
+
type _aux_setProject<A, P extends string> = setProject<A, P>;
|
|
336
|
+
type _aux_setStage<A, S extends ModelStage> = setStage<A, S>;
|
|
337
|
+
type _aux_toComputed<A> = toComputed<A>;
|
|
338
|
+
type _aux_toLayouted<A> = toLayouted<A>;
|
|
339
|
+
type _aux_toParsed<A> = toParsed<A>;
|
|
340
|
+
declare namespace _aux {
|
|
341
|
+
export type { _aux_AllKinds as _aux_AllKinds, _aux_Any as _aux_Any, Any as Any, _aux_AnySpec as _aux_AnySpec, _aux_Aux as _aux_Aux, _aux_DeploymentFqn as _aux_DeploymentFqn, _aux_DeploymentId as _aux_DeploymentId, _aux_DeploymentKind as _aux_DeploymentKind, _aux_EdgeId as _aux_EdgeId, _aux_ElementId as _aux_ElementId, _aux_ElementKind as _aux_ElementKind, _aux_Fqn as _aux_Fqn, _aux_LooseDeploymentId as _aux_LooseDeploymentId, _aux_LooseDeploymentKind as _aux_LooseDeploymentKind, _aux_LooseElementId as _aux_LooseElementId, _aux_LooseElementKind as _aux_LooseElementKind, _aux_LooseRelationKind as _aux_LooseRelationKind, _aux_LooseTag as _aux_LooseTag, _aux_LooseTags as _aux_LooseTags, _aux_LooseViewId as _aux_LooseViewId, _aux_Metadata as _aux_Metadata, _aux_MetadataKey as _aux_MetadataKey, _aux_Never as _aux_Never, _aux_NodeId as _aux_NodeId, _aux_OrString as _aux_OrString, _aux_PickByStage as _aux_PickByStage, _aux_ProjectId as _aux_ProjectId, _aux_RelationId as _aux_RelationId, _aux_RelationKind as _aux_RelationKind, _aux_Spec as _aux_Spec, _aux_SpecAux as _aux_SpecAux, _aux_Stage as _aux_Stage, DeploymentFqn$1 as DeploymentFqn$1, _aux_StrictDeploymentKind as _aux_StrictDeploymentKind, _aux_StrictElementKind as _aux_StrictElementKind, Fqn$1 as Fqn$1, _aux_StrictProjectId as _aux_StrictProjectId, _aux_StrictRelationKind as _aux_StrictRelationKind, _aux_StrictTag as _aux_StrictTag, _aux_StrictViewId as _aux_StrictViewId, _aux_Tag as _aux_Tag, _aux_Tags as _aux_Tags, _aux_Unknown as _aux_Unknown, _aux_UnknownComputed as _aux_UnknownComputed, _aux_UnknownLayouted as _aux_UnknownLayouted, _aux_UnknownParsed as _aux_UnknownParsed, _aux_ViewId as _aux_ViewId, _aux_WithLinks as _aux_WithLinks, _aux_WithMetadata as _aux_WithMetadata, _aux_WithOptionalLinks as _aux_WithOptionalLinks, _aux_WithOptionalTags as _aux_WithOptionalTags, _aux_WithTags as _aux_WithTags, _aux_setProject as _aux_setProject, _aux_setStage as _aux_setStage, _aux_toComputed as _aux_toComputed, _aux_toLayouted as _aux_toLayouted, _aux_toParsed as _aux_toParsed };
|
|
342
|
+
}
|
|
191
343
|
type SpacingSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
192
344
|
type TextSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
193
345
|
type ShapeSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
@@ -244,7 +396,7 @@ type AllNever = {
|
|
|
244
396
|
operator?: never;
|
|
245
397
|
};
|
|
246
398
|
type TagEqual<A extends Any> = Omit<AllNever, "tag"> & {
|
|
247
|
-
tag: EqualOperator<Tag$
|
|
399
|
+
tag: EqualOperator<Tag$2<A>> | Tag$2<A>;
|
|
248
400
|
};
|
|
249
401
|
type KindEqual<A extends Any> = Omit<AllNever, "kind"> & {
|
|
250
402
|
kind: EqualOperator<AllKinds<A>> | AllKinds<A>;
|
|
@@ -384,7 +536,7 @@ interface ElementStyle {
|
|
|
384
536
|
}
|
|
385
537
|
interface ComputedNode<A extends Any = Any> extends WithOptionalLinks {
|
|
386
538
|
id: NodeId;
|
|
387
|
-
kind: ElementKind<A> | DeploymentKind<A> | "@group";
|
|
539
|
+
kind: ElementKind$1<A> | DeploymentKind$1<A> | "@group";
|
|
388
540
|
parent: NodeId | null;
|
|
389
541
|
/**
|
|
390
542
|
* Reference to model element
|
|
@@ -425,7 +577,7 @@ interface ComputedEdge<A extends Any = Any> extends WithOptionalTags<A> {
|
|
|
425
577
|
relations: RelationId[];
|
|
426
578
|
kind?: RelationKind<A> | typeof StepEdgeKind;
|
|
427
579
|
notation?: string;
|
|
428
|
-
notes?:
|
|
580
|
+
notes?: MarkdownOrString;
|
|
429
581
|
color?: Color;
|
|
430
582
|
line?: RelationshipLineType;
|
|
431
583
|
head?: RelationshipArrowType;
|
|
@@ -1971,7 +2123,6 @@ type ControlsCustomLayoutProps = {
|
|
|
1971
2123
|
navigationButtons: ReactNode;
|
|
1972
2124
|
search: ReactNode;
|
|
1973
2125
|
actionsGroup: ReactNode;
|
|
1974
|
-
syncInProgressBadge: ReactNode;
|
|
1975
2126
|
};
|
|
1976
2127
|
type ControlsCustomLayout = (props: ControlsCustomLayoutProps) => ReactNode;
|
|
1977
2128
|
type Dimmed = "immediate" | boolean;
|
|
@@ -2124,7 +2275,7 @@ type ElementIconRendererProps = {
|
|
|
2124
2275
|
className?: string;
|
|
2125
2276
|
};
|
|
2126
2277
|
export type ElementIconRenderer = (props: ElementIconRendererProps) => ReactNode;
|
|
2127
|
-
type OnNavigateTo<A extends Any> = (to: ViewId
|
|
2278
|
+
type OnNavigateTo<A extends Any> = (to: _aux.ViewId<A>, event?: ReactMouseEvent, element?: DiagramNodeWithNavigate<A>) => void;
|
|
2128
2279
|
type OnNodeClick<A extends Any> = (node: DiagramNode<A>, event: ReactMouseEvent) => void;
|
|
2129
2280
|
type OnEdgeClick<A extends Any> = (edge: DiagramEdge<A>, event: ReactMouseEvent) => void;
|
|
2130
2281
|
type OnCanvasClick = (event: ReactMouseEvent) => void;
|
|
@@ -2135,7 +2286,15 @@ type OnChange = (event: ChangeEvent) => void;
|
|
|
2135
2286
|
type OverrideReactFlowProps = Pick<ReactFlowProps, "paneClickDistance" | "nodeClickDistance" | "selectionKeyCode" | "panActivationKeyCode" | "multiSelectionKeyCode" | "zoomActivationKeyCode" | "snapToGrid" | "snapGrid" | "onlyRenderVisibleElements" | "nodesDraggable" | "nodesFocusable" | "elementsSelectable" | "selectNodesOnDrag" | "panOnDrag" | "preventScrolling" | "zoomOnScroll" | "zoomOnPinch" | "panOnScroll" | "panOnScrollSpeed" | "panOnScrollMode" | "zoomOnDoubleClick" | "nodeDragThreshold">;
|
|
2136
2287
|
type PaddingUnit$1 = "px" | "%";
|
|
2137
2288
|
type PaddingWithUnit$1 = `${number}${PaddingUnit$1}` | number;
|
|
2138
|
-
|
|
2289
|
+
type ViewPadding = PaddingWithUnit$1 | {
|
|
2290
|
+
top?: PaddingWithUnit$1;
|
|
2291
|
+
right?: PaddingWithUnit$1;
|
|
2292
|
+
bottom?: PaddingWithUnit$1;
|
|
2293
|
+
left?: PaddingWithUnit$1;
|
|
2294
|
+
x?: PaddingWithUnit$1;
|
|
2295
|
+
y?: PaddingWithUnit$1;
|
|
2296
|
+
};
|
|
2297
|
+
interface LikeC4DiagramProperties<A extends _aux.Any> {
|
|
2139
2298
|
view: LayoutedView<A>;
|
|
2140
2299
|
className?: string | undefined;
|
|
2141
2300
|
/**
|
|
@@ -2155,10 +2314,11 @@ interface LikeC4DiagramProperties<A extends Any> {
|
|
|
2155
2314
|
readonly?: boolean | undefined;
|
|
2156
2315
|
/**
|
|
2157
2316
|
* Show/hide panel with top left controls,
|
|
2317
|
+
* - `next` - Experimental navigation panel
|
|
2158
2318
|
*
|
|
2159
2319
|
* @default true if not readonly
|
|
2160
2320
|
*/
|
|
2161
|
-
controls?: boolean | undefined;
|
|
2321
|
+
controls?: boolean | "next" | undefined;
|
|
2162
2322
|
/**
|
|
2163
2323
|
* If set, initial viewport will show all nodes & edges
|
|
2164
2324
|
* @default true
|
|
@@ -2167,8 +2327,29 @@ interface LikeC4DiagramProperties<A extends Any> {
|
|
|
2167
2327
|
/**
|
|
2168
2328
|
* Padding around the diagram
|
|
2169
2329
|
* @default '8px'
|
|
2170
|
-
|
|
2171
|
-
|
|
2330
|
+
*
|
|
2331
|
+
* @see {@link ViewPadding}
|
|
2332
|
+
*
|
|
2333
|
+
* @example
|
|
2334
|
+
* ```tsx
|
|
2335
|
+
* <LikeC4Diagram
|
|
2336
|
+
* fitViewPadding={{
|
|
2337
|
+
* x: '16px',
|
|
2338
|
+
* y: '16px',
|
|
2339
|
+
* }}
|
|
2340
|
+
* />
|
|
2341
|
+
*
|
|
2342
|
+
* <LikeC4Diagram
|
|
2343
|
+
* fitViewPadding={{
|
|
2344
|
+
* top: '8px',
|
|
2345
|
+
* right: '8px',
|
|
2346
|
+
* bottom: '8px',
|
|
2347
|
+
* left: '8px',
|
|
2348
|
+
* }}
|
|
2349
|
+
* />
|
|
2350
|
+
* ```
|
|
2351
|
+
*/
|
|
2352
|
+
fitViewPadding?: ViewPadding | undefined;
|
|
2172
2353
|
/**
|
|
2173
2354
|
* @default false if readonly
|
|
2174
2355
|
*/
|
|
@@ -2253,8 +2434,9 @@ interface LikeC4DiagramProperties<A extends Any> {
|
|
|
2253
2434
|
/**
|
|
2254
2435
|
* Improve performance by hiding certain elements and reducing visual effects (disable mix-blend, shadows, animations)
|
|
2255
2436
|
* Enable it if you have a large or static view
|
|
2437
|
+
* - `auto` - will be `true` if view has more then 3000 * 2000 pixels
|
|
2256
2438
|
*
|
|
2257
|
-
* @default 'auto'
|
|
2439
|
+
* @default 'auto'
|
|
2258
2440
|
*/
|
|
2259
2441
|
reduceGraphics?: "auto" | boolean | undefined;
|
|
2260
2442
|
/**
|
|
@@ -2264,6 +2446,11 @@ interface LikeC4DiagramProperties<A extends Any> {
|
|
|
2264
2446
|
renderIcon?: ElementIconRenderer | undefined;
|
|
2265
2447
|
/**
|
|
2266
2448
|
* Customize layout of the controls on the top left
|
|
2449
|
+
*
|
|
2450
|
+
* @note
|
|
2451
|
+
* Ignored if `controls="next"`
|
|
2452
|
+
*
|
|
2453
|
+
* @see {@link controls}
|
|
2267
2454
|
*/
|
|
2268
2455
|
renderControls?: ControlsCustomLayout | undefined;
|
|
2269
2456
|
/**
|
|
@@ -2279,18 +2466,18 @@ interface LikeC4DiagramProperties<A extends Any> {
|
|
|
2279
2466
|
*/
|
|
2280
2467
|
reactFlowProps?: OverrideReactFlowProps | undefined;
|
|
2281
2468
|
}
|
|
2282
|
-
type OpenSourceParams<A extends Any = Any> = {
|
|
2283
|
-
element: Fqn
|
|
2469
|
+
type OpenSourceParams<A extends _aux.Any = _aux.Any> = {
|
|
2470
|
+
element: _aux.Fqn<A>;
|
|
2284
2471
|
property?: string;
|
|
2285
2472
|
} | {
|
|
2286
|
-
relation: RelationId
|
|
2473
|
+
relation: _aux.RelationId;
|
|
2287
2474
|
} | {
|
|
2288
|
-
deployment: DeploymentFqn
|
|
2475
|
+
deployment: _aux.DeploymentFqn<A>;
|
|
2289
2476
|
property?: string;
|
|
2290
2477
|
} | {
|
|
2291
|
-
view: StrictViewId<A>;
|
|
2478
|
+
view: _aux.StrictViewId<A>;
|
|
2292
2479
|
};
|
|
2293
|
-
interface LikeC4DiagramEventHandlers<A extends Any> {
|
|
2480
|
+
interface LikeC4DiagramEventHandlers<A extends _aux.Any = _aux.Any> {
|
|
2294
2481
|
onChange?: OnChange | null | undefined;
|
|
2295
2482
|
onNavigateTo?: OnNavigateTo<A> | null | undefined;
|
|
2296
2483
|
onNodeClick?: OnNodeClick<A> | null | undefined;
|
|
@@ -2303,11 +2490,11 @@ interface LikeC4DiagramEventHandlers<A extends Any> {
|
|
|
2303
2490
|
onBurgerMenuClick?: null | undefined | (() => void);
|
|
2304
2491
|
onOpenSource?: null | undefined | ((params: OpenSourceParams<A>) => void);
|
|
2305
2492
|
}
|
|
2306
|
-
export interface LikeC4ViewProps<A extends Any> {
|
|
2493
|
+
export interface LikeC4ViewProps<A extends _aux.Any> {
|
|
2307
2494
|
/**
|
|
2308
2495
|
* View to display.
|
|
2309
2496
|
*/
|
|
2310
|
-
viewId: ViewId
|
|
2497
|
+
viewId: _aux.ViewId<A>;
|
|
2311
2498
|
/**
|
|
2312
2499
|
* Enable/disable panning
|
|
2313
2500
|
* @default false
|
|
@@ -2359,8 +2546,10 @@ export interface LikeC4ViewProps<A extends Any> {
|
|
|
2359
2546
|
/**
|
|
2360
2547
|
* Padding around the diagram
|
|
2361
2548
|
* @default '8px'
|
|
2549
|
+
*
|
|
2550
|
+
* @see {@link ViewPadding}
|
|
2362
2551
|
*/
|
|
2363
|
-
fitViewPadding?:
|
|
2552
|
+
fitViewPadding?: ViewPadding | undefined;
|
|
2364
2553
|
/**
|
|
2365
2554
|
* Display diagram title / description
|
|
2366
2555
|
*
|
|
@@ -2452,9 +2641,11 @@ interface LikeC4BrowserProps {
|
|
|
2452
2641
|
fitViewPadding?: PaddingWithUnit$1 | undefined;
|
|
2453
2642
|
/**
|
|
2454
2643
|
* Show/hide panel with top left controls,
|
|
2455
|
-
*
|
|
2644
|
+
* - `next` - show navigation panel (Experimental)
|
|
2645
|
+
*
|
|
2646
|
+
* @default `next`
|
|
2456
2647
|
*/
|
|
2457
|
-
controls?: boolean | undefined;
|
|
2648
|
+
controls?: boolean | "next" | undefined;
|
|
2458
2649
|
/**
|
|
2459
2650
|
* Display diagram title / description
|
|
2460
2651
|
*
|
|
@@ -2521,10 +2712,10 @@ interface LikeC4BrowserProps {
|
|
|
2521
2712
|
*/
|
|
2522
2713
|
reactFlowProps?: OverrideReactFlowProps | undefined;
|
|
2523
2714
|
}
|
|
2524
|
-
export declare function LikeC4View<A extends Any = UnknownLayouted>({ viewId, ...props }: LikeC4ViewProps<A>): import("react/jsx-runtime").JSX.Element;
|
|
2715
|
+
export declare function LikeC4View<A extends _aux.Any = _aux.UnknownLayouted>({ viewId, ...props }: LikeC4ViewProps<A>): import("react/jsx-runtime").JSX.Element;
|
|
2525
2716
|
type LikeC4DiagramProps<A extends Any = Any> = PropsWithChildren<LikeC4DiagramProperties<A> & LikeC4DiagramEventHandlers<A>>;
|
|
2526
|
-
export type ReactLikeC4Props<A extends Any> = Omit<LikeC4DiagramProps<A>, "view"> & {
|
|
2527
|
-
viewId: ViewId
|
|
2717
|
+
export type ReactLikeC4Props<A extends _aux.Any> = Omit<LikeC4DiagramProps<A>, "view"> & {
|
|
2718
|
+
viewId: _aux.ViewId<A>;
|
|
2528
2719
|
/**
|
|
2529
2720
|
* Keep aspect ratio of the diagram
|
|
2530
2721
|
* Disable if you need to manage the viewport (use className)
|
|
@@ -2549,7 +2740,7 @@ export type ReactLikeC4Props<A extends Any> = Omit<LikeC4DiagramProps<A>, "view"
|
|
|
2549
2740
|
/** Function to generate nonce attribute added to all generated `<style />` tags */
|
|
2550
2741
|
styleNonce?: string | (() => string) | undefined;
|
|
2551
2742
|
};
|
|
2552
|
-
export declare function ReactLikeC4<A extends Any = UnknownLayouted>({ viewId, ...props }: ReactLikeC4Props<A>): import("react/jsx-runtime").JSX.Element;
|
|
2743
|
+
export declare function ReactLikeC4<A extends _aux.Any = _aux.UnknownLayouted>({ viewId, ...props }: ReactLikeC4Props<A>): import("react/jsx-runtime").JSX.Element;
|
|
2553
2744
|
export declare namespace ReactLikeC4 {
|
|
2554
2745
|
var displayName: string;
|
|
2555
2746
|
}
|