@flowconsole/web 0.0.0-beta-20260127184843
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/LICENSE +202 -0
- package/dist/_.contribution-CNMVP3ek.js +124160 -0
- package/dist/components/ArchitectureDiagram.d.ts +16 -0
- package/dist/components/FlowConsoleLogo.d.ts +3 -0
- package/dist/components/NavigationPanel/NavigationPanel.d.ts +29 -0
- package/dist/components/NavigationPanel/NavigationPanelControls.d.ts +22 -0
- package/dist/components/NavigationPanel/NavigationPanelDropdown.d.ts +15 -0
- package/dist/components/NavigationPanel/SearchOverlay.d.ts +11 -0
- package/dist/components/NavigationPanel/index.d.ts +2 -0
- package/dist/components/VerticalSplit.d.ts +15 -0
- package/dist/components/Workbench/CodeDiagramWorkbench.d.ts +7 -0
- package/dist/components/ui/index.d.ts +92 -0
- package/dist/csharp-BQi3szM0.js +326 -0
- package/dist/csharp.contribution-Er9Y3QJk.js +7 -0
- package/dist/diagram/graphvizLayoutService.d.ts +2 -0
- package/dist/diagram/registry.d.ts +3 -0
- package/dist/diagram/theme.d.ts +9 -0
- package/dist/diagram/types.d.ts +89 -0
- package/dist/diagram/utils/scopedModel.d.ts +3 -0
- package/dist/flowconsole-web.css +1 -0
- package/dist/flowconsole-web.js +5184 -0
- package/dist/flowconsole-web.umd.cjs +1110 -0
- package/dist/go-D1-I258M.js +218 -0
- package/dist/go.contribution-D2SBTWls.js +7 -0
- package/dist/hooks/hooks.d.ts +24 -0
- package/dist/index.d.ts +9 -0
- package/dist/java-OBvaP_SS.js +232 -0
- package/dist/java.contribution-BVkCm4-Q.js +8 -0
- package/dist/languages/csharp/csharp.d.ts +2 -0
- package/dist/languages/go/go.d.ts +2 -0
- package/dist/languages/index.d.ts +4 -0
- package/dist/languages/java/java.d.ts +2 -0
- package/dist/languages/parseResultMapper.d.ts +26 -0
- package/dist/languages/python/python.d.ts +2 -0
- package/dist/languages/runtime.d.ts +4 -0
- package/dist/languages/types.d.ts +25 -0
- package/dist/languages/typescript/diagramRuntime.d.ts +93 -0
- package/dist/languages/typescript/evaluateDiagramCode.d.ts +2 -0
- package/dist/languages/typescript/modelToReactflowMapper.d.ts +3 -0
- package/dist/languages/typescript/samples.d.ts +4 -0
- package/dist/languages/typescript/typescript.d.ts +2 -0
- package/dist/python-CRr7iztI.js +294 -0
- package/dist/python.contribution-DDUpm_jJ.js +8 -0
- package/dist/reactflow/edges/FloatingConnectionLine.d.ts +13 -0
- package/dist/reactflow/edges/RelationshipEdge.d.ts +13 -0
- package/dist/reactflow/nodes/ContainerNode.d.ts +3 -0
- package/dist/reactflow/nodes/ElementNode.d.ts +3 -0
- package/dist/reactflow/nodes/HiddenHandles.d.ts +1 -0
- package/dist/reactflow/utils/floating.d.ts +24 -0
- package/dist/theme/ThemeProvider.d.ts +13 -0
- package/dist/types/theme.d.ts +5 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +94 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
comments: {
|
|
3
|
+
lineComment: "//",
|
|
4
|
+
blockComment: ["/*", "*/"]
|
|
5
|
+
},
|
|
6
|
+
brackets: [
|
|
7
|
+
["{", "}"],
|
|
8
|
+
["[", "]"],
|
|
9
|
+
["(", ")"]
|
|
10
|
+
],
|
|
11
|
+
autoClosingPairs: [
|
|
12
|
+
{ open: "{", close: "}" },
|
|
13
|
+
{ open: "[", close: "]" },
|
|
14
|
+
{ open: "(", close: ")" },
|
|
15
|
+
{ open: "`", close: "`", notIn: ["string"] },
|
|
16
|
+
{ open: '"', close: '"', notIn: ["string"] },
|
|
17
|
+
{ open: "'", close: "'", notIn: ["string", "comment"] }
|
|
18
|
+
],
|
|
19
|
+
surroundingPairs: [
|
|
20
|
+
{ open: "{", close: "}" },
|
|
21
|
+
{ open: "[", close: "]" },
|
|
22
|
+
{ open: "(", close: ")" },
|
|
23
|
+
{ open: "`", close: "`" },
|
|
24
|
+
{ open: '"', close: '"' },
|
|
25
|
+
{ open: "'", close: "'" }
|
|
26
|
+
]
|
|
27
|
+
}, n = {
|
|
28
|
+
defaultToken: "",
|
|
29
|
+
tokenPostfix: ".go",
|
|
30
|
+
keywords: [
|
|
31
|
+
"break",
|
|
32
|
+
"case",
|
|
33
|
+
"chan",
|
|
34
|
+
"const",
|
|
35
|
+
"continue",
|
|
36
|
+
"default",
|
|
37
|
+
"defer",
|
|
38
|
+
"else",
|
|
39
|
+
"fallthrough",
|
|
40
|
+
"for",
|
|
41
|
+
"func",
|
|
42
|
+
"go",
|
|
43
|
+
"goto",
|
|
44
|
+
"if",
|
|
45
|
+
"import",
|
|
46
|
+
"interface",
|
|
47
|
+
"map",
|
|
48
|
+
"package",
|
|
49
|
+
"range",
|
|
50
|
+
"return",
|
|
51
|
+
"select",
|
|
52
|
+
"struct",
|
|
53
|
+
"switch",
|
|
54
|
+
"type",
|
|
55
|
+
"var",
|
|
56
|
+
"bool",
|
|
57
|
+
"true",
|
|
58
|
+
"false",
|
|
59
|
+
"uint8",
|
|
60
|
+
"uint16",
|
|
61
|
+
"uint32",
|
|
62
|
+
"uint64",
|
|
63
|
+
"int8",
|
|
64
|
+
"int16",
|
|
65
|
+
"int32",
|
|
66
|
+
"int64",
|
|
67
|
+
"float32",
|
|
68
|
+
"float64",
|
|
69
|
+
"complex64",
|
|
70
|
+
"complex128",
|
|
71
|
+
"byte",
|
|
72
|
+
"rune",
|
|
73
|
+
"uint",
|
|
74
|
+
"int",
|
|
75
|
+
"uintptr",
|
|
76
|
+
"string",
|
|
77
|
+
"nil"
|
|
78
|
+
],
|
|
79
|
+
operators: [
|
|
80
|
+
"+",
|
|
81
|
+
"-",
|
|
82
|
+
"*",
|
|
83
|
+
"/",
|
|
84
|
+
"%",
|
|
85
|
+
"&",
|
|
86
|
+
"|",
|
|
87
|
+
"^",
|
|
88
|
+
"<<",
|
|
89
|
+
">>",
|
|
90
|
+
"&^",
|
|
91
|
+
"+=",
|
|
92
|
+
"-=",
|
|
93
|
+
"*=",
|
|
94
|
+
"/=",
|
|
95
|
+
"%=",
|
|
96
|
+
"&=",
|
|
97
|
+
"|=",
|
|
98
|
+
"^=",
|
|
99
|
+
"<<=",
|
|
100
|
+
">>=",
|
|
101
|
+
"&^=",
|
|
102
|
+
"&&",
|
|
103
|
+
"||",
|
|
104
|
+
"<-",
|
|
105
|
+
"++",
|
|
106
|
+
"--",
|
|
107
|
+
"==",
|
|
108
|
+
"<",
|
|
109
|
+
">",
|
|
110
|
+
"=",
|
|
111
|
+
"!",
|
|
112
|
+
"!=",
|
|
113
|
+
"<=",
|
|
114
|
+
">=",
|
|
115
|
+
":=",
|
|
116
|
+
"...",
|
|
117
|
+
"(",
|
|
118
|
+
")",
|
|
119
|
+
"",
|
|
120
|
+
"]",
|
|
121
|
+
"{",
|
|
122
|
+
"}",
|
|
123
|
+
",",
|
|
124
|
+
";",
|
|
125
|
+
".",
|
|
126
|
+
":"
|
|
127
|
+
],
|
|
128
|
+
// we include these common regular expressions
|
|
129
|
+
symbols: /[=><!~?:&|+\-*\/\^%]+/,
|
|
130
|
+
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
|
131
|
+
// The main tokenizer for our languages
|
|
132
|
+
tokenizer: {
|
|
133
|
+
root: [
|
|
134
|
+
// identifiers and keywords
|
|
135
|
+
[
|
|
136
|
+
/[a-zA-Z_]\w*/,
|
|
137
|
+
{
|
|
138
|
+
cases: {
|
|
139
|
+
"@keywords": { token: "keyword.$0" },
|
|
140
|
+
"@default": "identifier"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
// whitespace
|
|
145
|
+
{ include: "@whitespace" },
|
|
146
|
+
// [[ attributes ]].
|
|
147
|
+
[/\[\[.*\]\]/, "annotation"],
|
|
148
|
+
// Preprocessor directive
|
|
149
|
+
[/^\s*#\w+/, "keyword"],
|
|
150
|
+
// delimiters and operators
|
|
151
|
+
[/[{}()\[\]]/, "@brackets"],
|
|
152
|
+
[/[<>](?!@symbols)/, "@brackets"],
|
|
153
|
+
[
|
|
154
|
+
/@symbols/,
|
|
155
|
+
{
|
|
156
|
+
cases: {
|
|
157
|
+
"@operators": "delimiter",
|
|
158
|
+
"@default": ""
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
// numbers
|
|
163
|
+
[/\d*\d+[eE]([\-+]?\d+)?/, "number.float"],
|
|
164
|
+
[/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
|
|
165
|
+
[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/, "number.hex"],
|
|
166
|
+
[/0[0-7']*[0-7]/, "number.octal"],
|
|
167
|
+
[/0[bB][0-1']*[0-1]/, "number.binary"],
|
|
168
|
+
[/\d[\d']*/, "number"],
|
|
169
|
+
[/\d/, "number"],
|
|
170
|
+
// delimiter: after number because of .\d floats
|
|
171
|
+
[/[;,.]/, "delimiter"],
|
|
172
|
+
// strings
|
|
173
|
+
[/"([^"\\]|\\.)*$/, "string.invalid"],
|
|
174
|
+
// non-teminated string
|
|
175
|
+
[/"/, "string", "@string"],
|
|
176
|
+
[/`/, "string", "@rawstring"],
|
|
177
|
+
// characters
|
|
178
|
+
[/'[^\\']'/, "string"],
|
|
179
|
+
[/(')(@escapes)(')/, ["string", "string.escape", "string"]],
|
|
180
|
+
[/'/, "string.invalid"]
|
|
181
|
+
],
|
|
182
|
+
whitespace: [
|
|
183
|
+
[/[ \t\r\n]+/, ""],
|
|
184
|
+
[/\/\*\*(?!\/)/, "comment.doc", "@doccomment"],
|
|
185
|
+
[/\/\*/, "comment", "@comment"],
|
|
186
|
+
[/\/\/.*$/, "comment"]
|
|
187
|
+
],
|
|
188
|
+
comment: [
|
|
189
|
+
[/[^\/*]+/, "comment"],
|
|
190
|
+
// [/\/\*/, 'comment', '@push' ], // nested comment not allowed :-(
|
|
191
|
+
// [/\/\*/, 'comment.invalid' ], // this breaks block comments in the shape of /* //*/
|
|
192
|
+
[/\*\//, "comment", "@pop"],
|
|
193
|
+
[/[\/*]/, "comment"]
|
|
194
|
+
],
|
|
195
|
+
//Identical copy of comment above, except for the addition of .doc
|
|
196
|
+
doccomment: [
|
|
197
|
+
[/[^\/*]+/, "comment.doc"],
|
|
198
|
+
// [/\/\*/, 'comment.doc', '@push' ], // nested comment not allowed :-(
|
|
199
|
+
[/\/\*/, "comment.doc.invalid"],
|
|
200
|
+
[/\*\//, "comment.doc", "@pop"],
|
|
201
|
+
[/[\/*]/, "comment.doc"]
|
|
202
|
+
],
|
|
203
|
+
string: [
|
|
204
|
+
[/[^\\"]+/, "string"],
|
|
205
|
+
[/@escapes/, "string.escape"],
|
|
206
|
+
[/\\./, "string.escape.invalid"],
|
|
207
|
+
[/"/, "string", "@pop"]
|
|
208
|
+
],
|
|
209
|
+
rawstring: [
|
|
210
|
+
[/[^\`]/, "string"],
|
|
211
|
+
[/`/, "string", "@pop"]
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
export {
|
|
216
|
+
e as conf,
|
|
217
|
+
n as language
|
|
218
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type HoverOptions = {
|
|
2
|
+
openDelay?: number;
|
|
3
|
+
closeDelay?: number;
|
|
4
|
+
};
|
|
5
|
+
export declare function useHoverPopover({ openDelay, closeDelay }?: HoverOptions): {
|
|
6
|
+
opened: boolean;
|
|
7
|
+
activatedBy: "click" | "hover";
|
|
8
|
+
openByHover: () => void;
|
|
9
|
+
closeByHover: () => void;
|
|
10
|
+
toggleByClick: () => void;
|
|
11
|
+
close: () => void;
|
|
12
|
+
setOpened: (opened: boolean) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare function useNavigationHistory(initialId?: string): {
|
|
15
|
+
current: string | undefined;
|
|
16
|
+
canBack: boolean;
|
|
17
|
+
canForward: boolean;
|
|
18
|
+
goBack: () => void;
|
|
19
|
+
goForward: () => void;
|
|
20
|
+
visit: (id: string) => void;
|
|
21
|
+
history: string[];
|
|
22
|
+
index: number;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { CodeDiagramWorkbench } from './components/Workbench/CodeDiagramWorkbench';
|
|
2
|
+
export { NavigationPanel } from './components/NavigationPanel/NavigationPanel';
|
|
3
|
+
export { ArchitectureDiagram } from './components/ArchitectureDiagram';
|
|
4
|
+
export { FlowConsoleLogo } from './components/FlowConsoleLogo';
|
|
5
|
+
export * from './languages';
|
|
6
|
+
export * from './languages/types';
|
|
7
|
+
export * from './diagram/types';
|
|
8
|
+
export * from './types/theme';
|
|
9
|
+
export { ThemeProvider, useTheme } from './theme/ThemeProvider';
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
// the default separators except `@$`
|
|
3
|
+
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
|
4
|
+
comments: {
|
|
5
|
+
lineComment: "//",
|
|
6
|
+
blockComment: ["/*", "*/"]
|
|
7
|
+
},
|
|
8
|
+
brackets: [
|
|
9
|
+
["{", "}"],
|
|
10
|
+
["[", "]"],
|
|
11
|
+
["(", ")"]
|
|
12
|
+
],
|
|
13
|
+
autoClosingPairs: [
|
|
14
|
+
{ open: "{", close: "}" },
|
|
15
|
+
{ open: "[", close: "]" },
|
|
16
|
+
{ open: "(", close: ")" },
|
|
17
|
+
{ open: '"', close: '"' },
|
|
18
|
+
{ open: "'", close: "'" }
|
|
19
|
+
],
|
|
20
|
+
surroundingPairs: [
|
|
21
|
+
{ open: "{", close: "}" },
|
|
22
|
+
{ open: "[", close: "]" },
|
|
23
|
+
{ open: "(", close: ")" },
|
|
24
|
+
{ open: '"', close: '"' },
|
|
25
|
+
{ open: "'", close: "'" },
|
|
26
|
+
{ open: "<", close: ">" }
|
|
27
|
+
],
|
|
28
|
+
folding: {
|
|
29
|
+
markers: {
|
|
30
|
+
start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),
|
|
31
|
+
end: new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, t = {
|
|
35
|
+
defaultToken: "",
|
|
36
|
+
tokenPostfix: ".java",
|
|
37
|
+
keywords: [
|
|
38
|
+
"abstract",
|
|
39
|
+
"continue",
|
|
40
|
+
"for",
|
|
41
|
+
"new",
|
|
42
|
+
"switch",
|
|
43
|
+
"assert",
|
|
44
|
+
"default",
|
|
45
|
+
"goto",
|
|
46
|
+
"package",
|
|
47
|
+
"synchronized",
|
|
48
|
+
"boolean",
|
|
49
|
+
"do",
|
|
50
|
+
"if",
|
|
51
|
+
"private",
|
|
52
|
+
"this",
|
|
53
|
+
"break",
|
|
54
|
+
"double",
|
|
55
|
+
"implements",
|
|
56
|
+
"protected",
|
|
57
|
+
"throw",
|
|
58
|
+
"byte",
|
|
59
|
+
"else",
|
|
60
|
+
"import",
|
|
61
|
+
"public",
|
|
62
|
+
"throws",
|
|
63
|
+
"case",
|
|
64
|
+
"enum",
|
|
65
|
+
"instanceof",
|
|
66
|
+
"return",
|
|
67
|
+
"transient",
|
|
68
|
+
"catch",
|
|
69
|
+
"extends",
|
|
70
|
+
"int",
|
|
71
|
+
"short",
|
|
72
|
+
"try",
|
|
73
|
+
"char",
|
|
74
|
+
"final",
|
|
75
|
+
"interface",
|
|
76
|
+
"static",
|
|
77
|
+
"void",
|
|
78
|
+
"class",
|
|
79
|
+
"finally",
|
|
80
|
+
"long",
|
|
81
|
+
"strictfp",
|
|
82
|
+
"volatile",
|
|
83
|
+
"const",
|
|
84
|
+
"float",
|
|
85
|
+
"native",
|
|
86
|
+
"super",
|
|
87
|
+
"while",
|
|
88
|
+
"true",
|
|
89
|
+
"false",
|
|
90
|
+
"yield",
|
|
91
|
+
"record",
|
|
92
|
+
"sealed",
|
|
93
|
+
"non-sealed",
|
|
94
|
+
"permits"
|
|
95
|
+
],
|
|
96
|
+
operators: [
|
|
97
|
+
"=",
|
|
98
|
+
">",
|
|
99
|
+
"<",
|
|
100
|
+
"!",
|
|
101
|
+
"~",
|
|
102
|
+
"?",
|
|
103
|
+
":",
|
|
104
|
+
"==",
|
|
105
|
+
"<=",
|
|
106
|
+
">=",
|
|
107
|
+
"!=",
|
|
108
|
+
"&&",
|
|
109
|
+
"||",
|
|
110
|
+
"++",
|
|
111
|
+
"--",
|
|
112
|
+
"+",
|
|
113
|
+
"-",
|
|
114
|
+
"*",
|
|
115
|
+
"/",
|
|
116
|
+
"&",
|
|
117
|
+
"|",
|
|
118
|
+
"^",
|
|
119
|
+
"%",
|
|
120
|
+
"<<",
|
|
121
|
+
">>",
|
|
122
|
+
">>>",
|
|
123
|
+
"+=",
|
|
124
|
+
"-=",
|
|
125
|
+
"*=",
|
|
126
|
+
"/=",
|
|
127
|
+
"&=",
|
|
128
|
+
"|=",
|
|
129
|
+
"^=",
|
|
130
|
+
"%=",
|
|
131
|
+
"<<=",
|
|
132
|
+
">>=",
|
|
133
|
+
">>>="
|
|
134
|
+
],
|
|
135
|
+
// we include these common regular expressions
|
|
136
|
+
symbols: /[=><!~?:&|+\-*\/\^%]+/,
|
|
137
|
+
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
|
138
|
+
digits: /\d+(_+\d+)*/,
|
|
139
|
+
octaldigits: /[0-7]+(_+[0-7]+)*/,
|
|
140
|
+
binarydigits: /[0-1]+(_+[0-1]+)*/,
|
|
141
|
+
hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
|
|
142
|
+
// The main tokenizer for our languages
|
|
143
|
+
tokenizer: {
|
|
144
|
+
root: [
|
|
145
|
+
// Special keyword with a dash
|
|
146
|
+
["non-sealed", "keyword.non-sealed"],
|
|
147
|
+
// identifiers and keywords
|
|
148
|
+
[
|
|
149
|
+
/[a-zA-Z_$][\w$]*/,
|
|
150
|
+
{
|
|
151
|
+
cases: {
|
|
152
|
+
"@keywords": { token: "keyword.$0" },
|
|
153
|
+
"@default": "identifier"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
// whitespace
|
|
158
|
+
{ include: "@whitespace" },
|
|
159
|
+
// delimiters and operators
|
|
160
|
+
[/[{}()\[\]]/, "@brackets"],
|
|
161
|
+
[/[<>](?!@symbols)/, "@brackets"],
|
|
162
|
+
[
|
|
163
|
+
/@symbols/,
|
|
164
|
+
{
|
|
165
|
+
cases: {
|
|
166
|
+
"@operators": "delimiter",
|
|
167
|
+
"@default": ""
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
// @ annotations.
|
|
172
|
+
[/@\s*[a-zA-Z_\$][\w\$]*/, "annotation"],
|
|
173
|
+
// numbers
|
|
174
|
+
[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, "number.float"],
|
|
175
|
+
[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, "number.float"],
|
|
176
|
+
[/0[xX](@hexdigits)[Ll]?/, "number.hex"],
|
|
177
|
+
[/0(@octaldigits)[Ll]?/, "number.octal"],
|
|
178
|
+
[/0[bB](@binarydigits)[Ll]?/, "number.binary"],
|
|
179
|
+
[/(@digits)[fFdD]/, "number.float"],
|
|
180
|
+
[/(@digits)[lL]?/, "number"],
|
|
181
|
+
// delimiter: after number because of .\d floats
|
|
182
|
+
[/[;,.]/, "delimiter"],
|
|
183
|
+
// strings
|
|
184
|
+
[/"([^"\\]|\\.)*$/, "string.invalid"],
|
|
185
|
+
// non-teminated string
|
|
186
|
+
[/"""/, "string", "@multistring"],
|
|
187
|
+
[/"/, "string", "@string"],
|
|
188
|
+
// characters
|
|
189
|
+
[/'[^\\']'/, "string"],
|
|
190
|
+
[/(')(@escapes)(')/, ["string", "string.escape", "string"]],
|
|
191
|
+
[/'/, "string.invalid"]
|
|
192
|
+
],
|
|
193
|
+
whitespace: [
|
|
194
|
+
[/[ \t\r\n]+/, ""],
|
|
195
|
+
[/\/\*\*(?!\/)/, "comment.doc", "@javadoc"],
|
|
196
|
+
[/\/\*/, "comment", "@comment"],
|
|
197
|
+
[/\/\/.*$/, "comment"]
|
|
198
|
+
],
|
|
199
|
+
comment: [
|
|
200
|
+
[/[^\/*]+/, "comment"],
|
|
201
|
+
// [/\/\*/, 'comment', '@push' ], // nested comment not allowed :-(
|
|
202
|
+
// [/\/\*/, 'comment.invalid' ], // this breaks block comments in the shape of /* //*/
|
|
203
|
+
[/\*\//, "comment", "@pop"],
|
|
204
|
+
[/[\/*]/, "comment"]
|
|
205
|
+
],
|
|
206
|
+
//Identical copy of comment above, except for the addition of .doc
|
|
207
|
+
javadoc: [
|
|
208
|
+
[/[^\/*]+/, "comment.doc"],
|
|
209
|
+
// [/\/\*/, 'comment.doc', '@push' ], // nested comment not allowed :-(
|
|
210
|
+
[/\/\*/, "comment.doc.invalid"],
|
|
211
|
+
[/\*\//, "comment.doc", "@pop"],
|
|
212
|
+
[/[\/*]/, "comment.doc"]
|
|
213
|
+
],
|
|
214
|
+
string: [
|
|
215
|
+
[/[^\\"]+/, "string"],
|
|
216
|
+
[/@escapes/, "string.escape"],
|
|
217
|
+
[/\\./, "string.escape.invalid"],
|
|
218
|
+
[/"/, "string", "@pop"]
|
|
219
|
+
],
|
|
220
|
+
multistring: [
|
|
221
|
+
[/[^\\"]+/, "string"],
|
|
222
|
+
[/@escapes/, "string.escape"],
|
|
223
|
+
[/\\./, "string.escape.invalid"],
|
|
224
|
+
[/"""/, "string", "@pop"],
|
|
225
|
+
[/./, "string"]
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
export {
|
|
230
|
+
e as conf,
|
|
231
|
+
t as language
|
|
232
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ArchitectureDiagramModel, RelationshipKind } from '../diagram/types';
|
|
2
|
+
type ParseNode = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
className: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
parentId?: string;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
badge?: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
};
|
|
12
|
+
type ParseFlow = {
|
|
13
|
+
id: string;
|
|
14
|
+
sourceId: string;
|
|
15
|
+
targetId: string;
|
|
16
|
+
label?: string | null;
|
|
17
|
+
detail?: string;
|
|
18
|
+
kind?: RelationshipKind;
|
|
19
|
+
icon?: string;
|
|
20
|
+
};
|
|
21
|
+
export type ParseResult = {
|
|
22
|
+
nodes: ParseNode[];
|
|
23
|
+
flows: ParseFlow[];
|
|
24
|
+
};
|
|
25
|
+
export declare function mapParseResultToDiagramModel(result: ParseResult): ArchitectureDiagramModel;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Monaco } from '@monaco-editor/react';
|
|
2
|
+
import { ArchitectureDiagramModel } from '../diagram/types';
|
|
3
|
+
export type CodeSample = {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
code: string;
|
|
8
|
+
};
|
|
9
|
+
export type EvaluationResult = {
|
|
10
|
+
ok: true;
|
|
11
|
+
model: ArchitectureDiagramModel;
|
|
12
|
+
} | {
|
|
13
|
+
ok: false;
|
|
14
|
+
error: string;
|
|
15
|
+
};
|
|
16
|
+
export type SupportedLanguage = 'typescript' | 'python' | 'csharp' | 'java' | 'go';
|
|
17
|
+
export type LanguageDefinition = {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
monacoLanguage: string;
|
|
21
|
+
monacoSetup?: (monaco: Monaco) => void;
|
|
22
|
+
samples: CodeSample[];
|
|
23
|
+
defaultSampleId?: string;
|
|
24
|
+
evaluate: (source: string) => Promise<EvaluationResult>;
|
|
25
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export declare const ENTITY_TYPE_NAMES: readonly ["User", "ComputerSystem", "Container", "ReactApp", "RestApi", "Redis", "Postgres", "KafkaTopic", "MessageQueue", "ExternalService", "BackgroundJob"];
|
|
2
|
+
export type EntityTypeName = (typeof ENTITY_TYPE_NAMES)[number];
|
|
3
|
+
export type ConnectionKind = 'sync' | 'async' | 'event' | 'dependency';
|
|
4
|
+
export type ConnectionRecord = {
|
|
5
|
+
id: string;
|
|
6
|
+
sourceId: string;
|
|
7
|
+
targetId: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
detail?: string;
|
|
10
|
+
kind: ConnectionKind;
|
|
11
|
+
icon?: string;
|
|
12
|
+
muted?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type EntityRecord = {
|
|
15
|
+
id: string;
|
|
16
|
+
type: EntityTypeName;
|
|
17
|
+
name: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
parentId?: string;
|
|
20
|
+
tags?: string[];
|
|
21
|
+
badge?: string;
|
|
22
|
+
tone?: string;
|
|
23
|
+
metadata: Record<string, unknown>;
|
|
24
|
+
};
|
|
25
|
+
export type DiagramIntermediateModel = {
|
|
26
|
+
entities: EntityRecord[];
|
|
27
|
+
relationships: ConnectionRecord[];
|
|
28
|
+
flows: FlowRecord[];
|
|
29
|
+
};
|
|
30
|
+
export type FlowStepRecord = {
|
|
31
|
+
id: string;
|
|
32
|
+
edgeId: string;
|
|
33
|
+
sourceId: string;
|
|
34
|
+
targetId: string;
|
|
35
|
+
label?: string;
|
|
36
|
+
};
|
|
37
|
+
export type FlowRecord = {
|
|
38
|
+
id: string;
|
|
39
|
+
name?: string;
|
|
40
|
+
steps: FlowStepRecord[];
|
|
41
|
+
};
|
|
42
|
+
declare const ENTITY_META: unique symbol;
|
|
43
|
+
type EntityHandle = Record<string, unknown> & {
|
|
44
|
+
[ENTITY_META]: {
|
|
45
|
+
id: string;
|
|
46
|
+
type: EntityTypeName;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
type ConnectionOptions = {
|
|
50
|
+
detail?: string;
|
|
51
|
+
kind?: ConnectionKind;
|
|
52
|
+
icon?: string;
|
|
53
|
+
muted?: boolean;
|
|
54
|
+
};
|
|
55
|
+
export declare class DiagramRuntime {
|
|
56
|
+
private readonly entities;
|
|
57
|
+
private readonly entityOrder;
|
|
58
|
+
private readonly connections;
|
|
59
|
+
private readonly slugCounts;
|
|
60
|
+
private edgeCounter;
|
|
61
|
+
private readonly flows;
|
|
62
|
+
private flowCounter;
|
|
63
|
+
private activeFlowStack;
|
|
64
|
+
get createEntityInvoker(): (typeName: EntityTypeName, value: unknown) => any;
|
|
65
|
+
private ensureFlow;
|
|
66
|
+
private nextFlowId;
|
|
67
|
+
withActiveFlow(flowId: string, fn: () => void): void;
|
|
68
|
+
private getActiveFlowId;
|
|
69
|
+
createFlowBuilder(current: EntityHandle): FlowBuilder;
|
|
70
|
+
snapshot(): DiagramIntermediateModel;
|
|
71
|
+
private createEntity;
|
|
72
|
+
private resolveParentId;
|
|
73
|
+
private resolveId;
|
|
74
|
+
addConnection(source: EntityHandle, target: EntityHandle, label: string, kind: ConnectionKind, detail?: string, options?: ConnectionOptions): string;
|
|
75
|
+
addFlowStep(flowId: string, step: {
|
|
76
|
+
edgeId: string;
|
|
77
|
+
sourceId: string;
|
|
78
|
+
targetId: string;
|
|
79
|
+
label?: string;
|
|
80
|
+
}): string;
|
|
81
|
+
}
|
|
82
|
+
declare class FlowBuilder {
|
|
83
|
+
private runtime;
|
|
84
|
+
private current;
|
|
85
|
+
private flowId;
|
|
86
|
+
constructor(runtime: DiagramRuntime, current: EntityHandle, flowId: string);
|
|
87
|
+
then(entity: EntityHandle): this;
|
|
88
|
+
sendsRequestTo(target: EntityHandle, label: string, options?: ConnectionOptions): this;
|
|
89
|
+
getDataFrom(target: EntityHandle, label: string, options?: ConnectionOptions): this;
|
|
90
|
+
executesRequest(action: string, options?: ConnectionOptions): this;
|
|
91
|
+
inParallel(...branches: Array<() => FlowBuilder | void>): this;
|
|
92
|
+
}
|
|
93
|
+
export {};
|