@likec4/core 0.40.0 → 0.41.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/README.md +2 -6
- package/dist/cjs/colors/element.d.ts +68 -0
- package/dist/{esm/colors.js → cjs/colors/element.js} +9 -23
- package/dist/cjs/colors/index.d.ts +132 -0
- package/dist/cjs/colors/index.js +27 -0
- package/dist/cjs/colors/relationships.d.ts +57 -0
- package/dist/cjs/colors/relationships.js +76 -0
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.js +0 -22
- package/dist/cjs/types/computed-view.d.ts +10 -7
- package/dist/cjs/types/diagram.d.ts +14 -5
- package/dist/cjs/types/expression.d.ts +1 -1
- package/dist/cjs/types/relation.d.ts +12 -0
- package/dist/cjs/types/relation.js +12 -1
- package/dist/cjs/types/theme.d.ts +12 -14
- package/dist/cjs/types/view.d.ts +7 -4
- package/dist/cjs/types/view.js +1 -1
- package/dist/cjs/utils/fqn.d.ts +6 -1
- package/dist/cjs/utils/fqn.js +17 -4
- package/dist/cjs/utils/guards.d.ts +1 -0
- package/dist/cjs/utils/guards.js +7 -0
- package/dist/cjs/utils/index.d.ts +0 -1
- package/dist/cjs/utils/index.js +0 -11
- package/dist/esm/colors/element.d.ts +68 -0
- package/dist/{cjs/colors.js → esm/colors/element.js} +1 -33
- package/dist/esm/colors/index.d.ts +132 -0
- package/dist/esm/colors/index.js +9 -0
- package/dist/esm/colors/relationships.d.ts +57 -0
- package/dist/esm/colors/relationships.js +64 -0
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.js +1 -3
- package/dist/esm/types/computed-view.d.ts +10 -7
- package/dist/esm/types/diagram.d.ts +14 -5
- package/dist/esm/types/expression.d.ts +1 -1
- package/dist/esm/types/relation.d.ts +12 -0
- package/dist/esm/types/relation.js +3 -0
- package/dist/esm/types/theme.d.ts +12 -14
- package/dist/esm/types/view.d.ts +7 -4
- package/dist/esm/types/view.js +1 -1
- package/dist/esm/utils/fqn.d.ts +6 -1
- package/dist/esm/utils/fqn.js +16 -4
- package/dist/esm/utils/guards.d.ts +1 -0
- package/dist/esm/utils/guards.js +1 -0
- package/dist/esm/utils/index.d.ts +0 -1
- package/dist/esm/utils/index.js +0 -1
- package/package.json +52 -55
- package/dist/cjs/colors.d.ts +0 -148
- package/dist/cjs/compute-view/EdgeBuilder.d.ts +0 -6
- package/dist/cjs/compute-view/EdgeBuilder.js +0 -37
- package/dist/cjs/compute-view/compute-ctx.d.ts +0 -20
- package/dist/cjs/compute-view/compute-ctx.js +0 -91
- package/dist/cjs/compute-view/compute-element-view.d.ts +0 -3
- package/dist/cjs/compute-view/compute-element-view.js +0 -100
- package/dist/cjs/compute-view/compute-predicates.d.ts +0 -16
- package/dist/cjs/compute-view/compute-predicates.js +0 -363
- package/dist/cjs/compute-view/compute.d.ts +0 -14
- package/dist/cjs/compute-view/compute.js +0 -46
- package/dist/cjs/compute-view/index.d.ts +0 -4
- package/dist/cjs/compute-view/index.js +0 -49
- package/dist/cjs/compute-view/resolve-extended-views.d.ts +0 -6
- package/dist/cjs/compute-view/resolve-extended-views.js +0 -53
- package/dist/cjs/compute-view/resolve-relative-paths.d.ts +0 -2
- package/dist/cjs/compute-view/resolve-relative-paths.js +0 -84
- package/dist/cjs/compute-view/utils/anyPossibleRelations.d.ts +0 -2
- package/dist/cjs/compute-view/utils/anyPossibleRelations.js +0 -18
- package/dist/cjs/compute-view/utils/applyViewRuleStyles.d.ts +0 -2
- package/dist/cjs/compute-view/utils/applyViewRuleStyles.js +0 -57
- package/dist/cjs/compute-view/utils/sortNodes.d.ts +0 -19
- package/dist/cjs/compute-view/utils/sortNodes.js +0 -47
- package/dist/cjs/model-index/ModelIndex.d.ts +0 -27
- package/dist/cjs/model-index/ModelIndex.js +0 -139
- package/dist/cjs/model-index/index.d.ts +0 -1
- package/dist/cjs/model-index/index.js +0 -13
- package/dist/cjs/utils/compute-node-levels.d.ts +0 -7
- package/dist/cjs/utils/compute-node-levels.js +0 -48
- package/dist/esm/colors.d.ts +0 -148
- package/dist/esm/compute-view/EdgeBuilder.d.ts +0 -6
- package/dist/esm/compute-view/EdgeBuilder.js +0 -30
- package/dist/esm/compute-view/compute-ctx.d.ts +0 -20
- package/dist/esm/compute-view/compute-ctx.js +0 -100
- package/dist/esm/compute-view/compute-element-view.d.ts +0 -3
- package/dist/esm/compute-view/compute-element-view.js +0 -98
- package/dist/esm/compute-view/compute-predicates.d.ts +0 -16
- package/dist/esm/compute-view/compute-predicates.js +0 -324
- package/dist/esm/compute-view/compute.d.ts +0 -14
- package/dist/esm/compute-view/compute.js +0 -36
- package/dist/esm/compute-view/index.d.ts +0 -4
- package/dist/esm/compute-view/index.js +0 -4
- package/dist/esm/compute-view/resolve-extended-views.d.ts +0 -6
- package/dist/esm/compute-view/resolve-extended-views.js +0 -41
- package/dist/esm/compute-view/resolve-relative-paths.d.ts +0 -2
- package/dist/esm/compute-view/resolve-relative-paths.js +0 -76
- package/dist/esm/compute-view/utils/anyPossibleRelations.d.ts +0 -2
- package/dist/esm/compute-view/utils/anyPossibleRelations.js +0 -12
- package/dist/esm/compute-view/utils/applyViewRuleStyles.d.ts +0 -2
- package/dist/esm/compute-view/utils/applyViewRuleStyles.js +0 -50
- package/dist/esm/compute-view/utils/sortNodes.d.ts +0 -19
- package/dist/esm/compute-view/utils/sortNodes.js +0 -37
- package/dist/esm/model-index/ModelIndex.d.ts +0 -27
- package/dist/esm/model-index/ModelIndex.js +0 -127
- package/dist/esm/model-index/index.d.ts +0 -1
- package/dist/esm/model-index/index.js +0 -1
- package/dist/esm/utils/compute-node-levels.d.ts +0 -7
- package/dist/esm/utils/compute-node-levels.js +0 -31
package/README.md
CHANGED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare const ElementColors: {
|
|
2
|
+
readonly primary: {
|
|
3
|
+
fill: "#3b82f6";
|
|
4
|
+
stroke: "#2563eb";
|
|
5
|
+
hiContrast: "#eff6ff";
|
|
6
|
+
loContrast: "#bfdbfe";
|
|
7
|
+
};
|
|
8
|
+
readonly blue: {
|
|
9
|
+
fill: "#3b82f6";
|
|
10
|
+
stroke: "#2563eb";
|
|
11
|
+
hiContrast: "#eff6ff";
|
|
12
|
+
loContrast: "#bfdbfe";
|
|
13
|
+
};
|
|
14
|
+
readonly secondary: {
|
|
15
|
+
fill: "#0284c7";
|
|
16
|
+
stroke: "#0369a1";
|
|
17
|
+
hiContrast: "#f0f9ff";
|
|
18
|
+
loContrast: "#e0f2fe";
|
|
19
|
+
};
|
|
20
|
+
readonly sky: {
|
|
21
|
+
fill: "#0284c7";
|
|
22
|
+
stroke: "#0369a1";
|
|
23
|
+
hiContrast: "#f0f9ff";
|
|
24
|
+
loContrast: "#e0f2fe";
|
|
25
|
+
};
|
|
26
|
+
readonly muted: {
|
|
27
|
+
fill: "#64748b";
|
|
28
|
+
stroke: "#475569";
|
|
29
|
+
hiContrast: "#f8fafc";
|
|
30
|
+
loContrast: "#e2e8f0";
|
|
31
|
+
};
|
|
32
|
+
readonly slate: {
|
|
33
|
+
fill: "#64748b";
|
|
34
|
+
stroke: "#475569";
|
|
35
|
+
hiContrast: "#f8fafc";
|
|
36
|
+
loContrast: "#e2e8f0";
|
|
37
|
+
};
|
|
38
|
+
readonly gray: {
|
|
39
|
+
readonly fill: "#737373";
|
|
40
|
+
readonly stroke: "#525252";
|
|
41
|
+
readonly hiContrast: "#fafafa";
|
|
42
|
+
readonly loContrast: "#e5e5e5";
|
|
43
|
+
};
|
|
44
|
+
readonly red: {
|
|
45
|
+
readonly fill: "#b54548";
|
|
46
|
+
readonly stroke: "#8c333a";
|
|
47
|
+
readonly hiContrast: "#f8fafc";
|
|
48
|
+
readonly loContrast: "#F9C6C6";
|
|
49
|
+
};
|
|
50
|
+
readonly green: {
|
|
51
|
+
readonly fill: "#428a4f";
|
|
52
|
+
readonly stroke: "#2d5d39";
|
|
53
|
+
readonly hiContrast: "#f8fafc";
|
|
54
|
+
readonly loContrast: "#c2f0c2";
|
|
55
|
+
};
|
|
56
|
+
readonly amber: {
|
|
57
|
+
readonly fill: "#d97706";
|
|
58
|
+
readonly stroke: "#b45309";
|
|
59
|
+
readonly hiContrast: "#f8fafc";
|
|
60
|
+
readonly loContrast: "#ffe0c2";
|
|
61
|
+
};
|
|
62
|
+
readonly indigo: {
|
|
63
|
+
readonly fill: "#6366f1";
|
|
64
|
+
readonly stroke: "#4f46e5";
|
|
65
|
+
readonly hiContrast: "#eef2ff";
|
|
66
|
+
readonly loContrast: "#c7d2fe";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
@@ -1,38 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ElementColors = void 0;
|
|
1
7
|
const blue = {
|
|
2
|
-
// fill: colors.blue[500],
|
|
3
|
-
// stroke: colors.blue[600],
|
|
4
|
-
// hiContrast: colors.blue[50],
|
|
5
|
-
// loContrast: colors.blue[200],
|
|
6
8
|
fill: "#3b82f6",
|
|
7
9
|
stroke: "#2563eb",
|
|
8
10
|
hiContrast: "#eff6ff",
|
|
9
11
|
loContrast: "#bfdbfe"
|
|
10
12
|
};
|
|
11
13
|
const sky = {
|
|
12
|
-
// fill: colors.sky[600],
|
|
13
|
-
// stroke: colors.sky[700],
|
|
14
|
-
// hiContrast: colors.sky[50],
|
|
15
|
-
// loContrast: colors.sky[100],
|
|
16
14
|
fill: "#0284c7",
|
|
17
15
|
stroke: "#0369a1",
|
|
18
16
|
hiContrast: "#f0f9ff",
|
|
19
17
|
loContrast: "#e0f2fe"
|
|
20
18
|
};
|
|
21
19
|
const slate = {
|
|
22
|
-
// fill: colors.slate[500],
|
|
23
|
-
// stroke: colors.slate[600],
|
|
24
|
-
// hiContrast: colors.slate[50],
|
|
25
|
-
// loContrast: colors.slate[200],
|
|
26
20
|
fill: "#64748b",
|
|
27
21
|
stroke: "#475569",
|
|
28
22
|
hiContrast: "#f8fafc",
|
|
29
23
|
loContrast: "#e2e8f0"
|
|
30
24
|
};
|
|
31
|
-
|
|
32
|
-
lineColor: "#b1b1b1",
|
|
33
|
-
labelColor: "#b1b1b1"
|
|
34
|
-
};
|
|
35
|
-
export const Colors = {
|
|
25
|
+
const ElementColors = {
|
|
36
26
|
primary: blue,
|
|
37
27
|
blue,
|
|
38
28
|
secondary: sky,
|
|
@@ -85,6 +75,7 @@ export const Colors = {
|
|
|
85
75
|
loContrast: "#ffe0c2"
|
|
86
76
|
// colors.gray[800],
|
|
87
77
|
},
|
|
78
|
+
|
|
88
79
|
indigo: {
|
|
89
80
|
// fill: colors.indigo[500],
|
|
90
81
|
// stroke: colors.indigo[600],
|
|
@@ -96,9 +87,4 @@ export const Colors = {
|
|
|
96
87
|
loContrast: "#c7d2fe"
|
|
97
88
|
}
|
|
98
89
|
};
|
|
99
|
-
|
|
100
|
-
font: "Helvetica",
|
|
101
|
-
shadow: "#0a0a0a",
|
|
102
|
-
relation: RelationColors,
|
|
103
|
-
colors: Colors
|
|
104
|
-
};
|
|
90
|
+
exports.ElementColors = ElementColors;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { ElementColors } from './element';
|
|
2
|
+
import { RelationshipColors } from './relationships';
|
|
3
|
+
export declare const defaultTheme: {
|
|
4
|
+
elements: {
|
|
5
|
+
readonly primary: {
|
|
6
|
+
fill: "#3b82f6";
|
|
7
|
+
stroke: "#2563eb";
|
|
8
|
+
hiContrast: "#eff6ff";
|
|
9
|
+
loContrast: "#bfdbfe";
|
|
10
|
+
};
|
|
11
|
+
readonly blue: {
|
|
12
|
+
fill: "#3b82f6";
|
|
13
|
+
stroke: "#2563eb";
|
|
14
|
+
hiContrast: "#eff6ff";
|
|
15
|
+
loContrast: "#bfdbfe";
|
|
16
|
+
};
|
|
17
|
+
readonly secondary: {
|
|
18
|
+
fill: "#0284c7";
|
|
19
|
+
stroke: "#0369a1";
|
|
20
|
+
hiContrast: "#f0f9ff";
|
|
21
|
+
loContrast: "#e0f2fe";
|
|
22
|
+
};
|
|
23
|
+
readonly sky: {
|
|
24
|
+
fill: "#0284c7";
|
|
25
|
+
stroke: "#0369a1";
|
|
26
|
+
hiContrast: "#f0f9ff";
|
|
27
|
+
loContrast: "#e0f2fe";
|
|
28
|
+
};
|
|
29
|
+
readonly muted: {
|
|
30
|
+
fill: "#64748b";
|
|
31
|
+
stroke: "#475569";
|
|
32
|
+
hiContrast: "#f8fafc";
|
|
33
|
+
loContrast: "#e2e8f0";
|
|
34
|
+
};
|
|
35
|
+
readonly slate: {
|
|
36
|
+
fill: "#64748b";
|
|
37
|
+
stroke: "#475569";
|
|
38
|
+
hiContrast: "#f8fafc";
|
|
39
|
+
loContrast: "#e2e8f0";
|
|
40
|
+
};
|
|
41
|
+
readonly gray: {
|
|
42
|
+
readonly fill: "#737373";
|
|
43
|
+
readonly stroke: "#525252";
|
|
44
|
+
readonly hiContrast: "#fafafa";
|
|
45
|
+
readonly loContrast: "#e5e5e5";
|
|
46
|
+
};
|
|
47
|
+
readonly red: {
|
|
48
|
+
readonly fill: "#b54548";
|
|
49
|
+
readonly stroke: "#8c333a";
|
|
50
|
+
readonly hiContrast: "#f8fafc";
|
|
51
|
+
readonly loContrast: "#F9C6C6";
|
|
52
|
+
};
|
|
53
|
+
readonly green: {
|
|
54
|
+
readonly fill: "#428a4f";
|
|
55
|
+
readonly stroke: "#2d5d39";
|
|
56
|
+
readonly hiContrast: "#f8fafc";
|
|
57
|
+
readonly loContrast: "#c2f0c2";
|
|
58
|
+
};
|
|
59
|
+
readonly amber: {
|
|
60
|
+
readonly fill: "#d97706";
|
|
61
|
+
readonly stroke: "#b45309";
|
|
62
|
+
readonly hiContrast: "#f8fafc";
|
|
63
|
+
readonly loContrast: "#ffe0c2";
|
|
64
|
+
};
|
|
65
|
+
readonly indigo: {
|
|
66
|
+
readonly fill: "#6366f1";
|
|
67
|
+
readonly stroke: "#4f46e5";
|
|
68
|
+
readonly hiContrast: "#eef2ff";
|
|
69
|
+
readonly loContrast: "#c7d2fe";
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
relationships: {
|
|
73
|
+
amber: {
|
|
74
|
+
lineColor: "#b45309";
|
|
75
|
+
labelBgColor: "#78350f";
|
|
76
|
+
labelColor: "#f59e0b";
|
|
77
|
+
};
|
|
78
|
+
blue: {
|
|
79
|
+
lineColor: "#3b82f6";
|
|
80
|
+
labelBgColor: "#172554";
|
|
81
|
+
labelColor: "#60a5fa";
|
|
82
|
+
};
|
|
83
|
+
gray: {
|
|
84
|
+
lineColor: "#6E6E6E";
|
|
85
|
+
labelBgColor: "#18191b";
|
|
86
|
+
labelColor: "#C6C6C6";
|
|
87
|
+
};
|
|
88
|
+
green: {
|
|
89
|
+
lineColor: "#15803d";
|
|
90
|
+
labelBgColor: "#052e16";
|
|
91
|
+
labelColor: "#22c55e";
|
|
92
|
+
};
|
|
93
|
+
indigo: {
|
|
94
|
+
lineColor: "#6366f1";
|
|
95
|
+
labelBgColor: "#1e1b4b";
|
|
96
|
+
labelColor: "#818cf8";
|
|
97
|
+
};
|
|
98
|
+
muted: {
|
|
99
|
+
lineColor: "#64748b";
|
|
100
|
+
labelBgColor: "#0f172a";
|
|
101
|
+
labelColor: "#cbd5e1";
|
|
102
|
+
};
|
|
103
|
+
primary: {
|
|
104
|
+
lineColor: "#3b82f6";
|
|
105
|
+
labelBgColor: "#172554";
|
|
106
|
+
labelColor: "#60a5fa";
|
|
107
|
+
};
|
|
108
|
+
red: {
|
|
109
|
+
lineColor: "#b91c1c";
|
|
110
|
+
labelBgColor: "#b91c1c";
|
|
111
|
+
labelColor: "#dc2626";
|
|
112
|
+
};
|
|
113
|
+
secondary: {
|
|
114
|
+
lineColor: "#0ea5e9";
|
|
115
|
+
labelBgColor: "#082f49";
|
|
116
|
+
labelColor: "#38bdf8";
|
|
117
|
+
};
|
|
118
|
+
sky: {
|
|
119
|
+
lineColor: "#0ea5e9";
|
|
120
|
+
labelBgColor: "#082f49";
|
|
121
|
+
labelColor: "#38bdf8";
|
|
122
|
+
};
|
|
123
|
+
slate: {
|
|
124
|
+
lineColor: "#64748b";
|
|
125
|
+
labelBgColor: "#0f172a";
|
|
126
|
+
labelColor: "#cbd5e1";
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
font: "Helvetica";
|
|
130
|
+
shadow: "#0a0a0a";
|
|
131
|
+
};
|
|
132
|
+
export { ElementColors, RelationshipColors };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ElementColors", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _element.ElementColors;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "RelationshipColors", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _relationships.RelationshipColors;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
exports.defaultTheme = void 0;
|
|
19
|
+
var _element = require("./element");
|
|
20
|
+
var _relationships = require("./relationships");
|
|
21
|
+
const defaultTheme = {
|
|
22
|
+
elements: _element.ElementColors,
|
|
23
|
+
relationships: _relationships.RelationshipColors,
|
|
24
|
+
font: "Helvetica",
|
|
25
|
+
shadow: "#0a0a0a"
|
|
26
|
+
};
|
|
27
|
+
exports.defaultTheme = defaultTheme;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const RelationshipColors: {
|
|
2
|
+
amber: {
|
|
3
|
+
lineColor: "#b45309";
|
|
4
|
+
labelBgColor: "#78350f";
|
|
5
|
+
labelColor: "#f59e0b";
|
|
6
|
+
};
|
|
7
|
+
blue: {
|
|
8
|
+
lineColor: "#3b82f6";
|
|
9
|
+
labelBgColor: "#172554";
|
|
10
|
+
labelColor: "#60a5fa";
|
|
11
|
+
};
|
|
12
|
+
gray: {
|
|
13
|
+
lineColor: "#6E6E6E";
|
|
14
|
+
labelBgColor: "#18191b";
|
|
15
|
+
labelColor: "#C6C6C6";
|
|
16
|
+
};
|
|
17
|
+
green: {
|
|
18
|
+
lineColor: "#15803d";
|
|
19
|
+
labelBgColor: "#052e16";
|
|
20
|
+
labelColor: "#22c55e";
|
|
21
|
+
};
|
|
22
|
+
indigo: {
|
|
23
|
+
lineColor: "#6366f1";
|
|
24
|
+
labelBgColor: "#1e1b4b";
|
|
25
|
+
labelColor: "#818cf8";
|
|
26
|
+
};
|
|
27
|
+
muted: {
|
|
28
|
+
lineColor: "#64748b";
|
|
29
|
+
labelBgColor: "#0f172a";
|
|
30
|
+
labelColor: "#cbd5e1";
|
|
31
|
+
};
|
|
32
|
+
primary: {
|
|
33
|
+
lineColor: "#3b82f6";
|
|
34
|
+
labelBgColor: "#172554";
|
|
35
|
+
labelColor: "#60a5fa";
|
|
36
|
+
};
|
|
37
|
+
red: {
|
|
38
|
+
lineColor: "#b91c1c";
|
|
39
|
+
labelBgColor: "#b91c1c";
|
|
40
|
+
labelColor: "#dc2626";
|
|
41
|
+
};
|
|
42
|
+
secondary: {
|
|
43
|
+
lineColor: "#0ea5e9";
|
|
44
|
+
labelBgColor: "#082f49";
|
|
45
|
+
labelColor: "#38bdf8";
|
|
46
|
+
};
|
|
47
|
+
sky: {
|
|
48
|
+
lineColor: "#0ea5e9";
|
|
49
|
+
labelBgColor: "#082f49";
|
|
50
|
+
labelColor: "#38bdf8";
|
|
51
|
+
};
|
|
52
|
+
slate: {
|
|
53
|
+
lineColor: "#64748b";
|
|
54
|
+
labelBgColor: "#0f172a";
|
|
55
|
+
labelColor: "#cbd5e1";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RelationshipColors = void 0;
|
|
7
|
+
const gray = {
|
|
8
|
+
lineColor: "#6E6E6E",
|
|
9
|
+
labelBgColor: "#18191b",
|
|
10
|
+
labelColor: "#C6C6C6"
|
|
11
|
+
};
|
|
12
|
+
const slate = {
|
|
13
|
+
lineColor: "#64748b",
|
|
14
|
+
// 500
|
|
15
|
+
labelBgColor: "#0f172a",
|
|
16
|
+
// 900
|
|
17
|
+
labelColor: "#cbd5e1"
|
|
18
|
+
// 300
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const blue = {
|
|
22
|
+
lineColor: "#3b82f6",
|
|
23
|
+
// 500
|
|
24
|
+
labelBgColor: "#172554",
|
|
25
|
+
// 950
|
|
26
|
+
labelColor: "#60a5fa"
|
|
27
|
+
// 400
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const sky = {
|
|
31
|
+
lineColor: "#0ea5e9",
|
|
32
|
+
// 500
|
|
33
|
+
labelBgColor: "#082f49",
|
|
34
|
+
// 950
|
|
35
|
+
labelColor: "#38bdf8"
|
|
36
|
+
// 400
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const RelationshipColors = {
|
|
40
|
+
amber: {
|
|
41
|
+
lineColor: "#b45309",
|
|
42
|
+
labelBgColor: "#78350f",
|
|
43
|
+
labelColor: "#f59e0b"
|
|
44
|
+
},
|
|
45
|
+
blue,
|
|
46
|
+
gray,
|
|
47
|
+
green: {
|
|
48
|
+
lineColor: "#15803d",
|
|
49
|
+
// 700
|
|
50
|
+
labelBgColor: "#052e16",
|
|
51
|
+
//950
|
|
52
|
+
labelColor: "#22c55e"
|
|
53
|
+
// 500
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
indigo: {
|
|
57
|
+
lineColor: "#6366f1",
|
|
58
|
+
// 500
|
|
59
|
+
labelBgColor: "#1e1b4b",
|
|
60
|
+
// 950
|
|
61
|
+
labelColor: "#818cf8"
|
|
62
|
+
// 400
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
muted: slate,
|
|
66
|
+
primary: blue,
|
|
67
|
+
red: {
|
|
68
|
+
lineColor: "#b91c1c",
|
|
69
|
+
labelBgColor: "#b91c1c",
|
|
70
|
+
labelColor: "#dc2626"
|
|
71
|
+
},
|
|
72
|
+
secondary: sky,
|
|
73
|
+
sky,
|
|
74
|
+
slate
|
|
75
|
+
};
|
|
76
|
+
exports.RelationshipColors = RelationshipColors;
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -14,17 +14,6 @@ Object.keys(_colors).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
-
var _computeView = require("./compute-view");
|
|
18
|
-
Object.keys(_computeView).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _computeView[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _computeView[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
17
|
var _errors = require("./errors");
|
|
29
18
|
Object.keys(_errors).forEach(function (key) {
|
|
30
19
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -36,17 +25,6 @@ Object.keys(_errors).forEach(function (key) {
|
|
|
36
25
|
}
|
|
37
26
|
});
|
|
38
27
|
});
|
|
39
|
-
var _modelIndex = require("./model-index");
|
|
40
|
-
Object.keys(_modelIndex).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _modelIndex[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _modelIndex[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
28
|
var _types = require("./types");
|
|
51
29
|
Object.keys(_types).forEach(function (key) {
|
|
52
30
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Opaque } from './opaque';
|
|
2
2
|
import type { ElementKind, ElementShape, Fqn, Tag } from './element';
|
|
3
|
-
import type { RelationID } from './relation';
|
|
3
|
+
import type { RelationID, RelationshipArrowType, RelationshipLineType } from './relation';
|
|
4
4
|
import type { BasicElementView, ViewID, ViewRuleAutoLayout } from './view';
|
|
5
5
|
import type { IconUrl, NonEmptyArray } from './_common';
|
|
6
6
|
import type { ThemeColor } from './theme';
|
|
@@ -31,11 +31,14 @@ export interface ComputedEdge {
|
|
|
31
31
|
target: NodeId;
|
|
32
32
|
label: string | null;
|
|
33
33
|
relations: RelationID[];
|
|
34
|
+
color?: ThemeColor;
|
|
35
|
+
line?: RelationshipLineType;
|
|
36
|
+
head?: RelationshipArrowType;
|
|
37
|
+
tail?: RelationshipArrowType;
|
|
34
38
|
}
|
|
35
|
-
export interface ComputedView extends BasicElementView {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
edges: ComputedEdge[];
|
|
39
|
+
export interface ComputedView extends Omit<BasicElementView, 'rules'> {
|
|
40
|
+
readonly extends?: ViewID;
|
|
41
|
+
readonly autoLayout: ViewRuleAutoLayout['autoLayout'];
|
|
42
|
+
readonly nodes: ComputedNode[];
|
|
43
|
+
readonly edges: ComputedEdge[];
|
|
41
44
|
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { ColorLiteral } from './theme';
|
|
2
2
|
import type { ComputedEdge, ComputedNode, ComputedView } from './computed-view';
|
|
3
|
+
import type { NonEmptyArray } from './_common';
|
|
3
4
|
export type Point = [x: number, y: number];
|
|
5
|
+
export type BBox = {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
4
11
|
export interface DiagramLabel {
|
|
5
12
|
align: 'left' | 'right' | 'center';
|
|
6
13
|
fontStyle?: 'bold' | 'normal';
|
|
@@ -20,13 +27,15 @@ export interface DiagramNode extends ComputedNode {
|
|
|
20
27
|
depth?: number;
|
|
21
28
|
}
|
|
22
29
|
export interface DiagramEdge extends ComputedEdge {
|
|
23
|
-
points: Point
|
|
24
|
-
headArrow?: Point
|
|
25
|
-
|
|
30
|
+
points: NonEmptyArray<Point>;
|
|
31
|
+
headArrow?: NonEmptyArray<Point>;
|
|
32
|
+
tailArrow?: NonEmptyArray<Point>;
|
|
33
|
+
labels?: NonEmptyArray<DiagramLabel>;
|
|
34
|
+
labelBBox?: BBox;
|
|
26
35
|
}
|
|
27
36
|
export interface DiagramView extends Omit<ComputedView, 'nodes' | 'edges'> {
|
|
28
37
|
readonly nodes: DiagramNode[];
|
|
29
38
|
readonly edges: DiagramEdge[];
|
|
30
|
-
width: number;
|
|
31
|
-
height: number;
|
|
39
|
+
readonly width: number;
|
|
40
|
+
readonly height: number;
|
|
32
41
|
}
|
|
@@ -14,7 +14,7 @@ interface BaseExpr {
|
|
|
14
14
|
}
|
|
15
15
|
export interface ElementRefExpr extends Omit<BaseExpr, 'element' | 'isDescedants'> {
|
|
16
16
|
element: Fqn;
|
|
17
|
-
isDescedants
|
|
17
|
+
isDescedants?: boolean;
|
|
18
18
|
}
|
|
19
19
|
export declare function isElementRef(expr: Expression): expr is ElementRefExpr;
|
|
20
20
|
export interface WildcardExpr extends Omit<BaseExpr, 'wildcard'> {
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import type { Opaque } from './opaque';
|
|
2
2
|
import type { Fqn, Tag } from './element';
|
|
3
|
+
import type { ThemeColor } from './theme';
|
|
3
4
|
export type RelationID = Opaque<string, 'RelationID'>;
|
|
5
|
+
export type RelationshipKind = Opaque<string, 'RelationshipKind'>;
|
|
6
|
+
export type RelationshipLineType = 'dashed' | 'solid' | 'dotted';
|
|
7
|
+
export type RelationshipArrowType = 'none' | 'normal' | 'onormal' | 'diamond' | 'odiamond' | 'crow' | 'open' | 'vee';
|
|
8
|
+
export declare const DefaultLineStyle = "dashed";
|
|
9
|
+
export declare const DefaultArrowType = "normal";
|
|
10
|
+
export declare const DefaultRelationshipColor = "gray";
|
|
4
11
|
export interface Relation {
|
|
5
12
|
readonly id: RelationID;
|
|
6
13
|
readonly source: Fqn;
|
|
7
14
|
readonly target: Fqn;
|
|
8
15
|
readonly title: string;
|
|
9
16
|
readonly tags?: Tag[];
|
|
17
|
+
readonly kind?: RelationshipKind;
|
|
18
|
+
readonly color?: ThemeColor;
|
|
19
|
+
readonly line?: RelationshipLineType;
|
|
20
|
+
readonly head?: RelationshipArrowType;
|
|
21
|
+
readonly tail?: RelationshipArrowType;
|
|
10
22
|
}
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DefaultRelationshipColor = exports.DefaultLineStyle = exports.DefaultArrowType = void 0;
|
|
7
|
+
const DefaultLineStyle = "dashed";
|
|
8
|
+
exports.DefaultLineStyle = DefaultLineStyle;
|
|
9
|
+
const DefaultArrowType = "normal";
|
|
10
|
+
exports.DefaultArrowType = DefaultArrowType;
|
|
11
|
+
const DefaultRelationshipColor = "gray";
|
|
12
|
+
exports.DefaultRelationshipColor = DefaultRelationshipColor;
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
export type ThemeColor = 'amber' | 'blue' | 'gray' | 'slate' | 'green' | 'indigo' | 'muted' | 'primary' | 'red' | 'secondary' | 'sky';
|
|
2
2
|
export type HexColorLiteral = `#${string}`;
|
|
3
3
|
export type ColorLiteral = HexColorLiteral;
|
|
4
|
-
export
|
|
5
|
-
HexColorLiteral,
|
|
6
|
-
{
|
|
7
|
-
onHover: HexColorLiteral;
|
|
8
|
-
}
|
|
9
|
-
];
|
|
10
|
-
export interface ThemeColorValues {
|
|
4
|
+
export interface ElementThemeColorValues {
|
|
11
5
|
fill: ColorLiteral;
|
|
12
6
|
stroke: ColorLiteral;
|
|
13
7
|
hiContrast: ColorLiteral;
|
|
14
8
|
loContrast: ColorLiteral;
|
|
15
9
|
}
|
|
16
|
-
export type
|
|
17
|
-
[key in ThemeColor]:
|
|
10
|
+
export type ElementThemeColors = {
|
|
11
|
+
[key in ThemeColor]: ElementThemeColorValues;
|
|
18
12
|
};
|
|
19
|
-
export interface
|
|
20
|
-
lineColor:
|
|
21
|
-
|
|
13
|
+
export interface RelationshipThemeColorValues {
|
|
14
|
+
lineColor: ColorLiteral;
|
|
15
|
+
labelBgColor: ColorLiteral;
|
|
16
|
+
labelColor: ColorLiteral;
|
|
22
17
|
}
|
|
18
|
+
export type RelationshipThemeColors = {
|
|
19
|
+
[key in ThemeColor]: RelationshipThemeColorValues;
|
|
20
|
+
};
|
|
23
21
|
export interface LikeC4Theme {
|
|
24
22
|
font: 'Helvetica';
|
|
25
23
|
shadow: ColorLiteral;
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
relationships: RelationshipThemeColors;
|
|
25
|
+
elements: ElementThemeColors;
|
|
28
26
|
}
|
package/dist/cjs/types/view.d.ts
CHANGED
|
@@ -4,10 +4,13 @@ import type { ElementExpression, Expression } from './expression';
|
|
|
4
4
|
import type { IconUrl, NonEmptyArray } from './_common';
|
|
5
5
|
import type { ThemeColor } from './theme';
|
|
6
6
|
export type ViewID = Opaque<string, 'ViewID'>;
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
7
|
+
export type ViewRuleExpression = {
|
|
8
|
+
include: Expression[];
|
|
9
|
+
exclude?: never;
|
|
10
|
+
} | {
|
|
11
|
+
include?: never;
|
|
12
|
+
exclude: Expression[];
|
|
13
|
+
};
|
|
11
14
|
export declare function isViewRuleExpression(rule: ViewRule): rule is ViewRuleExpression;
|
|
12
15
|
export interface ViewRuleStyle {
|
|
13
16
|
targets: ElementExpression[];
|
package/dist/cjs/types/view.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.isViewRuleAutoLayout = isViewRuleAutoLayout;
|
|
|
9
9
|
exports.isViewRuleExpression = isViewRuleExpression;
|
|
10
10
|
exports.isViewRuleStyle = isViewRuleStyle;
|
|
11
11
|
function isViewRuleExpression(rule) {
|
|
12
|
-
return "
|
|
12
|
+
return "include" in rule && Array.isArray(rule.include) || "exclude" in rule && Array.isArray(rule.exclude);
|
|
13
13
|
}
|
|
14
14
|
function isViewRuleStyle(rule) {
|
|
15
15
|
return "style" in rule && "targets" in rule;
|