@standarx/graph 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.fr.md +436 -0
- package/README.md +435 -2
- package/THIRD_PARTY_NOTICES.md +22 -0
- package/assets/fonts/Inter-Regular.ttf +0 -0
- package/assets/fonts/Inter-SemiBold.ttf +0 -0
- package/assets/fonts/OFL.txt +92 -0
- package/dist/adapter-0bggwh8x.js +393 -0
- package/dist/cli-4m00785g.js +20 -0
- package/dist/cli-5v9761s9.js +330 -0
- package/dist/cli-9f1pdw5q.js +462 -0
- package/dist/cli-a4ax1vkc.js +172 -0
- package/dist/cli-b4n941t8.js +1439 -0
- package/dist/cli-eqq7a3wz.js +1144 -0
- package/dist/cli-gh5166k6.js +1565 -0
- package/dist/cli-kzp16pt5.js +207 -0
- package/dist/cli-mzmjkk5v.js +11 -0
- package/dist/cli-njgyf690.js +1060 -0
- package/dist/cli-nkm2j980.js +141 -0
- package/dist/cli-nyckgf1t.js +4 -0
- package/dist/cli-sfdqkbd1.js +433 -0
- package/dist/cli-txrzzr2q.js +0 -0
- package/dist/cli-vecew2na.js +709 -0
- package/dist/cli-wt9dmbhm.js +560 -0
- package/dist/cli-xhdxp3cj.js +387 -0
- package/dist/cli-ywgtv1cg.js +39 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +415 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +93 -0
- package/dist/core/spatial.d.ts +16 -0
- package/dist/core/threshold.d.ts +1 -0
- package/dist/core/view.d.ts +80 -0
- package/dist/export/index.d.ts +18 -0
- package/dist/export/index.js +172 -0
- package/dist/export/pdf.d.ts +5 -0
- package/dist/export/png.d.ts +4 -0
- package/dist/format/index.d.ts +4 -0
- package/dist/format/index.js +71 -0
- package/dist/format/json-schema.d.ts +2 -0
- package/dist/format/schema.d.ts +787 -0
- package/dist/format/semantic/er.d.ts +3 -0
- package/dist/format/semantic/graph.d.ts +3 -0
- package/dist/format/semantic/sequence.d.ts +3 -0
- package/dist/format/semantic/shared.d.ts +14 -0
- package/dist/format/semantic/state.d.ts +3 -0
- package/dist/format/semantic/tree.d.ts +3 -0
- package/dist/format/transition-label.d.ts +2 -0
- package/dist/format/validate.d.ts +11 -0
- package/dist/html/index.d.ts +3 -0
- package/dist/html/index.js +127 -0
- package/dist/html/layout-worker.d.ts +1 -0
- package/dist/html/layout-worker.generated.d.ts +1 -0
- package/dist/html/mount.d.ts +12 -0
- package/dist/html/page.d.ts +14 -0
- package/dist/html/render.d.ts +7 -0
- package/dist/html/runtime.d.ts +1 -0
- package/dist/html/runtime.generated.d.ts +1 -0
- package/dist/html/shell.d.ts +10 -0
- package/dist/html/svg-adapter.d.ts +8 -0
- package/dist/html/ui.d.ts +34 -0
- package/dist/language/analysis.d.ts +38 -0
- package/dist/language/complete.d.ts +3 -0
- package/dist/language/docs.d.ts +11 -0
- package/dist/language/format.d.ts +17 -0
- package/dist/language/hover.d.ts +3 -0
- package/dist/language/index.d.ts +6 -0
- package/dist/language/index.js +1385 -0
- package/dist/language/navigation.d.ts +9 -0
- package/dist/language/positions.d.ts +7 -0
- package/dist/language/symbols.d.ts +3 -0
- package/dist/language/types.d.ts +34 -0
- package/dist/layout/elk.d.ts +35 -0
- package/dist/layout/er.d.ts +3 -0
- package/dist/layout/font-metrics.d.ts +9 -0
- package/dist/layout/graph.d.ts +3 -0
- package/dist/layout/index.d.ts +5 -0
- package/dist/layout/index.js +17 -0
- package/dist/layout/measure.d.ts +10 -0
- package/dist/layout/sequence.d.ts +3 -0
- package/dist/layout/shapes.d.ts +16 -0
- package/dist/layout/shared.d.ts +31 -0
- package/dist/layout/state.d.ts +3 -0
- package/dist/layout/tree.d.ts +3 -0
- package/dist/layout/types.d.ts +198 -0
- package/dist/layout-worker.generated-emmvgfb1.js +34 -0
- package/dist/mermaid/common.d.ts +36 -0
- package/dist/mermaid/er.d.ts +3 -0
- package/dist/mermaid/graph.d.ts +4 -0
- package/dist/mermaid/index.d.ts +6 -0
- package/dist/mermaid/index.js +6 -0
- package/dist/mermaid/mindmap.d.ts +3 -0
- package/dist/mermaid/sequence.d.ts +3 -0
- package/dist/mermaid/state.d.ts +3 -0
- package/dist/remark/index.d.ts +9 -0
- package/dist/remark/index.js +104 -0
- package/dist/shared/errors.d.ts +6 -0
- package/dist/shared/package-root.d.ts +5 -0
- package/dist/svg/escape.d.ts +1 -0
- package/dist/svg/index.d.ts +3 -0
- package/dist/svg/index.js +25 -0
- package/dist/svg/render.d.ts +9 -0
- package/dist/svg/theme.d.ts +62 -0
- package/dist/svg-adapter-gq5vmp6q.js +227 -0
- package/dist/text/build.d.ts +10 -0
- package/dist/text/canonical.d.ts +10 -0
- package/dist/text/errors.d.ts +33 -0
- package/dist/text/highlight.d.ts +13 -0
- package/dist/text/index.d.ts +33 -0
- package/dist/text/index.js +27 -0
- package/dist/text/lexer.d.ts +29 -0
- package/dist/text/parser.d.ts +160 -0
- package/dist/text/print.d.ts +6 -0
- package/dist/text/slug.d.ts +1 -0
- package/dist/text/syntax.d.ts +8 -0
- package/dist/version.d.ts +1 -0
- package/dist/webgl/adapter.d.ts +4 -0
- package/dist/webgl/index.d.ts +7 -0
- package/dist/webgl/index.js +15 -0
- package/dist/webgl/runtime.d.ts +1 -0
- package/dist/webgl/runtime.generated.d.ts +1 -0
- package/grammars/standargraph.tmLanguage.json +599 -0
- package/language-configuration.json +35 -0
- package/licenses/EPL-2.0.txt +277 -0
- package/licenses/MPL-2.0.txt +373 -0
- package/package.json +133 -4
- package/schema/graph-document.v1.json +1737 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Sink, type Range, type TextError } from "./errors";
|
|
2
|
+
export type TokenKind = "NEWLINE" | "STRING" | "QUOTED_ID" | "REPLY" | "ASYNC" | "ARROW" | "LINE" | "CARD" | "DOTS" | "PUNCT" | "NUMBER" | "IDENT" | "ERROR" | "EOF";
|
|
3
|
+
export type Token = {
|
|
4
|
+
kind: TokenKind;
|
|
5
|
+
text: string;
|
|
6
|
+
value: string;
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const IDENT: RegExp;
|
|
11
|
+
export declare function normalize(source: string): string;
|
|
12
|
+
export declare class Lexer {
|
|
13
|
+
private readonly source;
|
|
14
|
+
private readonly sink;
|
|
15
|
+
private readonly comments?;
|
|
16
|
+
pos: number;
|
|
17
|
+
private depth;
|
|
18
|
+
private openAt;
|
|
19
|
+
constructor(source: string, sink: Sink, comments?: Range[] | undefined);
|
|
20
|
+
seek(pos: number): void;
|
|
21
|
+
next(): Token;
|
|
22
|
+
private token;
|
|
23
|
+
private advance;
|
|
24
|
+
private quoted;
|
|
25
|
+
}
|
|
26
|
+
export declare function tokenize(source: string): {
|
|
27
|
+
tokens: Token[];
|
|
28
|
+
errors: TextError[];
|
|
29
|
+
};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { Cardinality } from "../format/schema";
|
|
2
|
+
import { type Range, type Sink } from "./errors";
|
|
3
|
+
import { type Token } from "./lexer";
|
|
4
|
+
export type Kind = "graph" | "sequence" | "state" | "er" | "tree";
|
|
5
|
+
export type OpSymbol = "->" | "--" | "->>" | "-->" | "..";
|
|
6
|
+
export type Str = {
|
|
7
|
+
value: string;
|
|
8
|
+
range: Range;
|
|
9
|
+
};
|
|
10
|
+
export type Ident = {
|
|
11
|
+
value: string;
|
|
12
|
+
range: Range;
|
|
13
|
+
};
|
|
14
|
+
export type Value = {
|
|
15
|
+
type: "string";
|
|
16
|
+
value: string;
|
|
17
|
+
range: Range;
|
|
18
|
+
} | {
|
|
19
|
+
type: "number";
|
|
20
|
+
value: number;
|
|
21
|
+
range: Range;
|
|
22
|
+
} | {
|
|
23
|
+
type: "ident";
|
|
24
|
+
value: string;
|
|
25
|
+
range: Range;
|
|
26
|
+
} | {
|
|
27
|
+
type: "list";
|
|
28
|
+
items: Value[];
|
|
29
|
+
range: Range;
|
|
30
|
+
};
|
|
31
|
+
export type AttrNode = {
|
|
32
|
+
key: string;
|
|
33
|
+
keyRange: Range;
|
|
34
|
+
value: Value;
|
|
35
|
+
range: Range;
|
|
36
|
+
};
|
|
37
|
+
export type Op = {
|
|
38
|
+
symbol: OpSymbol;
|
|
39
|
+
range: Range;
|
|
40
|
+
};
|
|
41
|
+
export type Endpoint = {
|
|
42
|
+
star: boolean;
|
|
43
|
+
value: string;
|
|
44
|
+
range: Range;
|
|
45
|
+
};
|
|
46
|
+
export type Card = {
|
|
47
|
+
value: Cardinality;
|
|
48
|
+
range: Range;
|
|
49
|
+
};
|
|
50
|
+
export type Opener = {
|
|
51
|
+
text: "{" | "do";
|
|
52
|
+
range: Range;
|
|
53
|
+
};
|
|
54
|
+
type Common = {
|
|
55
|
+
label?: Str;
|
|
56
|
+
attrs: AttrNode[];
|
|
57
|
+
range: Range;
|
|
58
|
+
incomplete?: true;
|
|
59
|
+
};
|
|
60
|
+
export type GraphStmt = ({
|
|
61
|
+
t: "group";
|
|
62
|
+
id: Ident;
|
|
63
|
+
body: GraphStmt[];
|
|
64
|
+
} & Common) | ({
|
|
65
|
+
t: "node";
|
|
66
|
+
id: Ident;
|
|
67
|
+
} & Common) | ({
|
|
68
|
+
t: "chain";
|
|
69
|
+
ids: Ident[];
|
|
70
|
+
ops: Op[];
|
|
71
|
+
} & Common);
|
|
72
|
+
export type SequenceStmt = ({
|
|
73
|
+
t: "participant";
|
|
74
|
+
id: Ident;
|
|
75
|
+
} & Common) | ({
|
|
76
|
+
t: "message";
|
|
77
|
+
from: Ident;
|
|
78
|
+
to: Ident;
|
|
79
|
+
op: Op;
|
|
80
|
+
} & Common);
|
|
81
|
+
export type StateStmt = ({
|
|
82
|
+
t: "state";
|
|
83
|
+
id: Ident;
|
|
84
|
+
body?: StateStmt[];
|
|
85
|
+
} & Common) | ({
|
|
86
|
+
t: "transition";
|
|
87
|
+
from: Endpoint;
|
|
88
|
+
to: Endpoint;
|
|
89
|
+
op: Op;
|
|
90
|
+
} & Common);
|
|
91
|
+
export type AttributeLine = {
|
|
92
|
+
name: Ident;
|
|
93
|
+
type?: Str;
|
|
94
|
+
flags: {
|
|
95
|
+
value: string;
|
|
96
|
+
range: Range;
|
|
97
|
+
}[];
|
|
98
|
+
attrs: AttrNode[];
|
|
99
|
+
range: Range;
|
|
100
|
+
incomplete?: true;
|
|
101
|
+
};
|
|
102
|
+
export type ErStmt = ({
|
|
103
|
+
t: "entity";
|
|
104
|
+
id: Ident;
|
|
105
|
+
attributes?: AttributeLine[];
|
|
106
|
+
} & Common) | ({
|
|
107
|
+
t: "relation";
|
|
108
|
+
from: Ident;
|
|
109
|
+
fromCard?: Card;
|
|
110
|
+
op: Op;
|
|
111
|
+
toCard?: Card;
|
|
112
|
+
to: Ident;
|
|
113
|
+
} & Common);
|
|
114
|
+
export type TreeLine = {
|
|
115
|
+
label: Str;
|
|
116
|
+
attrs: AttrNode[];
|
|
117
|
+
parent: number;
|
|
118
|
+
range: Range;
|
|
119
|
+
incomplete?: true;
|
|
120
|
+
};
|
|
121
|
+
export type Header = {
|
|
122
|
+
kindRange: Range;
|
|
123
|
+
title?: Str;
|
|
124
|
+
attrs: AttrNode[];
|
|
125
|
+
range: Range;
|
|
126
|
+
missing?: true;
|
|
127
|
+
};
|
|
128
|
+
export type Ast = {
|
|
129
|
+
kind: "graph";
|
|
130
|
+
header: Header;
|
|
131
|
+
body: GraphStmt[];
|
|
132
|
+
} | {
|
|
133
|
+
kind: "sequence";
|
|
134
|
+
header: Header;
|
|
135
|
+
body: SequenceStmt[];
|
|
136
|
+
} | {
|
|
137
|
+
kind: "state";
|
|
138
|
+
header: Header;
|
|
139
|
+
body: StateStmt[];
|
|
140
|
+
} | {
|
|
141
|
+
kind: "er";
|
|
142
|
+
header: Header;
|
|
143
|
+
body: ErStmt[];
|
|
144
|
+
} | {
|
|
145
|
+
kind: "tree";
|
|
146
|
+
header: Header;
|
|
147
|
+
body: TreeLine[];
|
|
148
|
+
};
|
|
149
|
+
export declare const KINDS: readonly Kind[];
|
|
150
|
+
export declare const FLAGS: Set<string>;
|
|
151
|
+
export declare const CARDINALITIES: ReadonlyMap<string, Cardinality>;
|
|
152
|
+
export declare const OPERATOR_WORDS: ReadonlyMap<string, OpSymbol>;
|
|
153
|
+
export declare const OPERATOR_RULES: Readonly<Record<Kind, {
|
|
154
|
+
noun: string;
|
|
155
|
+
allowed: readonly OpSymbol[];
|
|
156
|
+
}>>;
|
|
157
|
+
export declare function operatorOf(token: Token): OpSymbol | undefined;
|
|
158
|
+
export declare function parseSyntax(source: string, sink: Sink): Ast | undefined;
|
|
159
|
+
export declare function parseSyntaxPartial(source: string, sink: Sink): Ast;
|
|
160
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function slug(label: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERSION: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Document } from "../format";
|
|
2
|
+
import type { LaidOut } from "../layout/types";
|
|
3
|
+
import { type PageOptions } from "../html/shell";
|
|
4
|
+
export { WEBGL_THRESHOLD } from "../core/threshold";
|
|
5
|
+
export { VERSION } from "../version";
|
|
6
|
+
export type WebglOptions = PageOptions;
|
|
7
|
+
export declare function renderWebglHtml(document: Document, laidOut: LaidOut, options?: WebglOptions): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderWebglHtml2
|
|
3
|
+
} from "../cli-a4ax1vkc.js";
|
|
4
|
+
import {
|
|
5
|
+
WEBGL_THRESHOLD2
|
|
6
|
+
} from "../cli-nyckgf1t.js";
|
|
7
|
+
import"../cli-5v9761s9.js";
|
|
8
|
+
import {
|
|
9
|
+
VERSION2
|
|
10
|
+
} from "../cli-nkm2j980.js";
|
|
11
|
+
export {
|
|
12
|
+
VERSION2 as VERSION,
|
|
13
|
+
WEBGL_THRESHOLD2 as WEBGL_THRESHOLD,
|
|
14
|
+
renderWebglHtml2 as renderWebglHtml
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|