@cardenelabs/cdl 0.23.0 → 0.24.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/CHANGELOG.md +60 -1
- package/dist/index.cjs +109 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +109 -62
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +105 -62
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +105 -62
- package/dist/react.js.map +1 -1
- package/dist/{render-Czv0tUon.d.cts → render-CfXUl0Yz.d.cts} +18 -1
- package/dist/{render-Czv0tUon.d.ts → render-CfXUl0Yz.d.ts} +18 -1
- package/package.json +1 -1
- package/src/builder.ts +7 -0
- package/src/kinds/generic.tsx +92 -14
- package/src/presets.ts +7 -1
- package/src/render/edges.tsx +42 -17
- package/src/types.ts +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,64 @@ CDL (Chainome Diagram Language) の主要変更履歴。
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.24.0] - 2026-09-02
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **見せ方を持つ箱に目印を出すようにした** (#620)
|
|
13
|
+
|
|
14
|
+
`#616` で足した `look` が消費側の画面に出なかった。 dragon の `cdl-theme.css` が
|
|
15
|
+
`node-body > rect` の `fill` を `!important` で固定しており、`look` が決めた面
|
|
16
|
+
(`none` / 薄い面 / 墨のベタ) が全て既定の面に潰れていた。
|
|
17
|
+
|
|
18
|
+
消費側は「見せ方を持つ箱」 と「持たない箱」 を区別できない。 markup に手掛かりが無かった。
|
|
19
|
+
|
|
20
|
+
`look` を持つ kind の箱に `data-cdl-look` を出す。 持たない kind には出さない
|
|
21
|
+
(空文字を出すと消費側の `:not()` が効かなくなる)。
|
|
22
|
+
|
|
23
|
+
- **辺に役目を持たせ、順路を朱で引けるようにした** (#618)
|
|
24
|
+
|
|
25
|
+
辺の見せ方が 1 通りしかなく、太さも名前の置き方も図の役目に関わらず同じだった。
|
|
26
|
+
`infra-demo` は「要求が通る道」 と「App が持つ預け先」 の 2 種を持つが、どちらも同じ線で
|
|
27
|
+
描かれ、どこから読むかが決まらない。
|
|
28
|
+
|
|
29
|
+
| 足したもの | 既定 | 書くと |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| `role: "main"` | tone の色 | 「いま」 の色 (`--cdl-now`) で引く |
|
|
32
|
+
| `labelPlate: false` | 丸い下地を敷く | 字だけを線の上に置く |
|
|
33
|
+
|
|
34
|
+
線の太さの既定を下げた (光って 5 → 2.5、光らず 2.5 → 1.25)。
|
|
35
|
+
消費側 (dragon) が `!important` で 2.25 に上書きしており、箱の枠 (1.75) より太かった。
|
|
36
|
+
|
|
37
|
+
**値は 3 層を通る**。 `InfraConnection` (書き手の入口) → `edge()` (基底の組立て) →
|
|
38
|
+
`CdlEdge` (描く側) のすべてに足さないと、設定しても何も起きない。
|
|
39
|
+
当初 1 層目だけに足して黙って落ちた。
|
|
40
|
+
|
|
41
|
+
- **箱の見せ方を色でなく形で選べるようにした** (#616)
|
|
42
|
+
|
|
43
|
+
箱の見せ方が全種別で同じで、違いは枠線の色と右上の絵記号だけだった。
|
|
44
|
+
色で種別を分ける形は、消費側の配色によっては読めない。 dragon の茶墨は種別の色が
|
|
45
|
+
4 つとも暗く彩度が低く、枠線の面積では差が出ない (隔たりは 18.6 以上あるが効かない)。
|
|
46
|
+
|
|
47
|
+
`KindStyle` に `look` を足し、面と枠の描き方を 5 通りから選べるようにした。
|
|
48
|
+
|
|
49
|
+
| `look` | 描き方 | 何を示すか | 当てた種別 |
|
|
50
|
+
|---|---|---|---|
|
|
51
|
+
| `outline` | 面を塗らず枠だけ | 図の外にある | `person` |
|
|
52
|
+
| `tint` | 文字色 6% の面 | 通り道 | `cdn` |
|
|
53
|
+
| `solid` | 文字色のベタ + 紙色の字 | ここが働く | `service` |
|
|
54
|
+
| `ledger` | 面 + 底に二重の罫 | 消えては困る | `queue` |
|
|
55
|
+
| `dashed` | 面を塗らず破線の枠 | 作り直せる | `cache` |
|
|
56
|
+
|
|
57
|
+
未指定は従来どおりで、`look` を書いた 5 種別だけが変わる。
|
|
58
|
+
|
|
59
|
+
**`ledger` は四角の箱にだけ効く**。 円筒や雲は形そのものが役目を示しており、底の罫を
|
|
60
|
+
足す場所が無い。 `database` は円筒なので当てていない。
|
|
61
|
+
|
|
62
|
+
**ベタ塗りでも枠は種別の色のまま**。 「光っている節の枠は種別の色」 は既存の契約で、
|
|
63
|
+
`node-styling` が守っている。 面だけを墨で塗る。
|
|
64
|
+
|
|
65
|
+
|
|
8
66
|
## [0.23.0] - 2026-09-02
|
|
9
67
|
|
|
10
68
|
### Added
|
|
@@ -1185,7 +1243,8 @@ Initial OSS release.
|
|
|
1185
1243
|
使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
|
|
1186
1244
|
行き止まりになる。
|
|
1187
1245
|
|
|
1188
|
-
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.
|
|
1246
|
+
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.24.0...HEAD
|
|
1247
|
+
[0.24.0]: https://github.com/cardene777/cdl/compare/v0.23.0...v0.24.0
|
|
1189
1248
|
[0.23.0]: https://github.com/cardene777/cdl/compare/v0.22.0...v0.23.0
|
|
1190
1249
|
[0.22.0]: https://github.com/cardene777/cdl/compare/v0.21.2...v0.22.0
|
|
1191
1250
|
[0.21.2]: https://github.com/cardene777/cdl/compare/v0.21.1...v0.21.2
|
package/dist/index.cjs
CHANGED
|
@@ -9493,6 +9493,8 @@ function diagram(id, options) {
|
|
|
9493
9493
|
tone: opts.tone ?? "accent",
|
|
9494
9494
|
side: opts.side,
|
|
9495
9495
|
style: opts.style,
|
|
9496
|
+
role: opts.role,
|
|
9497
|
+
labelPlate: opts.labelPlate,
|
|
9496
9498
|
head: opts.head,
|
|
9497
9499
|
headFill: opts.headFill,
|
|
9498
9500
|
tailHead: opts.tailHead,
|
|
@@ -21979,6 +21981,12 @@ function edgeHeadPaint(head, fill, color) {
|
|
|
21979
21981
|
}
|
|
21980
21982
|
return { fill: color, stroke: "none" };
|
|
21981
21983
|
}
|
|
21984
|
+
function defaultEdgeWidth(active) {
|
|
21985
|
+
return active ? 2.5 : 1.25;
|
|
21986
|
+
}
|
|
21987
|
+
function edgeColor(edge) {
|
|
21988
|
+
return edge.role === "main" ? "var(--cdl-now, #c0421f)" : toneColor(edge.tone);
|
|
21989
|
+
}
|
|
21982
21990
|
function opacityAttr(opacity) {
|
|
21983
21991
|
return opacity < 1 ? opacity : void 0;
|
|
21984
21992
|
}
|
|
@@ -21992,7 +22000,7 @@ function CdlEdgeView({
|
|
|
21992
22000
|
progress,
|
|
21993
22001
|
stateValues
|
|
21994
22002
|
}) {
|
|
21995
|
-
const color =
|
|
22003
|
+
const color = edgeColor(edge);
|
|
21996
22004
|
const \u7AEF\u306E\u540D\u524D = (h, f) => {
|
|
21997
22005
|
const \u5F62 = h ?? EDGE_HEAD_DEFAULT;
|
|
21998
22006
|
if (\u5F62 === "none") return void 0;
|
|
@@ -22082,7 +22090,7 @@ function SolidEdgePath({
|
|
|
22082
22090
|
stateValues
|
|
22083
22091
|
}) {
|
|
22084
22092
|
const visibleD = drawing ? pathSubpath(edge.d, progress) : edge.d;
|
|
22085
|
-
const defaultWidth = active
|
|
22093
|
+
const defaultWidth = defaultEdgeWidth(active);
|
|
22086
22094
|
const boundWidth = edge.widthBind && stateValues ? resolveNumericAttr(edge.widthBind, stateValues, defaultWidth) : defaultWidth;
|
|
22087
22095
|
const boundStroke = edge.strokeBind && stateValues ? interpolate(edge.strokeBind, stateValues) : color;
|
|
22088
22096
|
const boundDashOffset = edge.dashOffsetBind && stateValues ? resolveNumericAttr(edge.dashOffsetBind, stateValues, 0) : void 0;
|
|
@@ -22159,7 +22167,7 @@ function CdlEdgeGlowView({
|
|
|
22159
22167
|
active
|
|
22160
22168
|
}) {
|
|
22161
22169
|
if (!active) return null;
|
|
22162
|
-
const color =
|
|
22170
|
+
const color = edgeColor(edge);
|
|
22163
22171
|
return /* @__PURE__ */ jsxRuntime.jsx(EdgeGlowCircles, { color, edgeId: edge.id });
|
|
22164
22172
|
}
|
|
22165
22173
|
function CdlEdgeLabelView({
|
|
@@ -22167,7 +22175,7 @@ function CdlEdgeLabelView({
|
|
|
22167
22175
|
active
|
|
22168
22176
|
}) {
|
|
22169
22177
|
if (!hasRenderedLabel(edge)) return null;
|
|
22170
|
-
const color =
|
|
22178
|
+
const color = edgeColor(edge);
|
|
22171
22179
|
const bbox = computeLabelBBoxWorld(edge);
|
|
22172
22180
|
const boxW = bbox.w;
|
|
22173
22181
|
const boxH = bbox.h;
|
|
@@ -22185,7 +22193,7 @@ function CdlEdgeLabelView({
|
|
|
22185
22193
|
"data-cdl-edge-label-text": edge.label,
|
|
22186
22194
|
"data-cdl-edge-sub-text": edge.sub ?? "",
|
|
22187
22195
|
children: [
|
|
22188
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22196
|
+
edge.labelPlate !== false && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22189
22197
|
"rect",
|
|
22190
22198
|
{
|
|
22191
22199
|
"data-cdl-role": "edge-label-bg",
|
|
@@ -22908,9 +22916,29 @@ function StorageNode({
|
|
|
22908
22916
|
})
|
|
22909
22917
|
] });
|
|
22910
22918
|
}
|
|
22919
|
+
var TINT_FILL = "color-mix(in srgb, var(--cdl-text, #1a1f2a) 6%, transparent)";
|
|
22920
|
+
function lookPaint(look, accent, active) {
|
|
22921
|
+
const \u65E2\u5B9A\u67A0 = active ? accent : "var(--cdl-divider, #d4d4d8)";
|
|
22922
|
+
const \u65E2\u5B9A\u592A\u3055 = active ? 3 : 1.25;
|
|
22923
|
+
switch (look) {
|
|
22924
|
+
case "outline":
|
|
22925
|
+
return { fill: "none", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: false };
|
|
22926
|
+
case "tint":
|
|
22927
|
+
return { fill: TINT_FILL, stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: false };
|
|
22928
|
+
case "solid":
|
|
22929
|
+
return { fill: "var(--cdl-text, #1a1f2a)", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: true };
|
|
22930
|
+
case "ledger":
|
|
22931
|
+
return { fill: "var(--cdl-node-fill, #ffffff)", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: false };
|
|
22932
|
+
case "dashed":
|
|
22933
|
+
return { fill: "none", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, dash: "6 4", onSolid: false };
|
|
22934
|
+
default:
|
|
22935
|
+
return { fill: "var(--cdl-node-fill, #ffffff)", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: false };
|
|
22936
|
+
}
|
|
22937
|
+
}
|
|
22911
22938
|
var STYLES = {
|
|
22912
22939
|
// 人系
|
|
22913
22940
|
person: {
|
|
22941
|
+
look: "outline",
|
|
22914
22942
|
accent: "var(--cdl-tone-accent, #2d6a8f)",
|
|
22915
22943
|
eyebrowColor: "var(--cdl-tone-accent, #2d6a8f)",
|
|
22916
22944
|
icon: "M12 12c2.2 0 4-1.8 4-4s-1.8-4-4-4-4 1.8-4 4 1.8 4 4 4zm0 2c-2.7 0-8 1.3-8 4v2h16v-2c0-2.7-5.3-4-8-4z"
|
|
@@ -22943,11 +22971,13 @@ var STYLES = {
|
|
|
22943
22971
|
shape: "cylinder"
|
|
22944
22972
|
},
|
|
22945
22973
|
cache: {
|
|
22974
|
+
look: "dashed",
|
|
22946
22975
|
accent: "var(--cdl-tone-warning, #a67a2e)",
|
|
22947
22976
|
eyebrowColor: "var(--cdl-tone-warning, #a67a2e)",
|
|
22948
22977
|
icon: "M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"
|
|
22949
22978
|
},
|
|
22950
22979
|
queue: {
|
|
22980
|
+
look: "ledger",
|
|
22951
22981
|
accent: "var(--cdl-tone-warning, #a67a2e)",
|
|
22952
22982
|
eyebrowColor: "var(--cdl-tone-warning, #a67a2e)",
|
|
22953
22983
|
icon: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z"
|
|
@@ -22964,12 +22994,14 @@ var STYLES = {
|
|
|
22964
22994
|
shape: "cloud"
|
|
22965
22995
|
},
|
|
22966
22996
|
cdn: {
|
|
22997
|
+
look: "tint",
|
|
22967
22998
|
accent: "var(--cdl-tone-info, #5a8ec1)",
|
|
22968
22999
|
eyebrowColor: "var(--cdl-tone-info, #5a8ec1)",
|
|
22969
23000
|
icon: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"
|
|
22970
23001
|
},
|
|
22971
23002
|
// アプリ系
|
|
22972
23003
|
service: {
|
|
23004
|
+
look: "solid",
|
|
22973
23005
|
accent: "var(--cdl-tone-teal, #2f8770)",
|
|
22974
23006
|
eyebrowColor: "var(--cdl-tone-teal, #2f8770)",
|
|
22975
23007
|
icon: "M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"
|
|
@@ -23041,6 +23073,7 @@ function GenericNode({
|
|
|
23041
23073
|
const w = node.w;
|
|
23042
23074
|
const h = node.h;
|
|
23043
23075
|
const shape = style.shape ?? "rect";
|
|
23076
|
+
const paint = lookPaint(style.look, style.accent, active);
|
|
23044
23077
|
const shapeEl = (() => {
|
|
23045
23078
|
if (shape === "cylinder") {
|
|
23046
23079
|
const rx = w / 2;
|
|
@@ -23098,19 +23131,23 @@ function GenericNode({
|
|
|
23098
23131
|
circles.map((c, i) => /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: c.cx, cy: c.cy, r: c.r - (active ? 1.5 : 0.75), fill: "var(--cdl-node-fill, #ffffff)" }, `mask-${i}`))
|
|
23099
23132
|
] });
|
|
23100
23133
|
}
|
|
23101
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
23102
|
-
|
|
23103
|
-
|
|
23104
|
-
|
|
23105
|
-
|
|
23106
|
-
|
|
23107
|
-
|
|
23108
|
-
|
|
23109
|
-
|
|
23110
|
-
|
|
23111
|
-
|
|
23112
|
-
|
|
23113
|
-
|
|
23134
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
23135
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
23136
|
+
"rect",
|
|
23137
|
+
{
|
|
23138
|
+
x: 0,
|
|
23139
|
+
y: 0,
|
|
23140
|
+
width: w,
|
|
23141
|
+
height: h,
|
|
23142
|
+
rx: 18,
|
|
23143
|
+
fill: paint.fill,
|
|
23144
|
+
stroke: paint.stroke,
|
|
23145
|
+
strokeWidth: paint.strokeWidth,
|
|
23146
|
+
strokeDasharray: paint.dash
|
|
23147
|
+
}
|
|
23148
|
+
),
|
|
23149
|
+
style.look === "ledger" && /* @__PURE__ */ jsxRuntime.jsx("line", { x1: 1, y1: h - 7, x2: w - 1, y2: h - 7, stroke: paint.stroke, strokeWidth: 1 })
|
|
23150
|
+
] });
|
|
23114
23151
|
})();
|
|
23115
23152
|
const resolvedValue = value !== void 0 ? interpolate(value, stateValues) : void 0;
|
|
23116
23153
|
const hasRows = (node.rows?.length ?? 0) > 0;
|
|
@@ -23133,56 +23170,64 @@ function GenericNode({
|
|
|
23133
23170
|
const iconX = centered ? w / 2 + 40 : w - 48;
|
|
23134
23171
|
const iconY = centered ? h / 2 - 44 - \u7D75\u306E\u82AF : 18 + cylinderShift;
|
|
23135
23172
|
const dominantBaseline = centered ? "middle" : void 0;
|
|
23136
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
23137
|
-
|
|
23138
|
-
|
|
23139
|
-
|
|
23140
|
-
|
|
23141
|
-
|
|
23142
|
-
|
|
23143
|
-
|
|
23144
|
-
|
|
23145
|
-
|
|
23146
|
-
|
|
23147
|
-
|
|
23148
|
-
x:
|
|
23149
|
-
y:
|
|
23150
|
-
fontSize:
|
|
23151
|
-
|
|
23152
|
-
textAnchor: "end",
|
|
23153
|
-
fill: "var(--cdl-text, #1a1f2a)",
|
|
23154
|
-
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23155
|
-
children: resolvedValue
|
|
23156
|
-
}
|
|
23157
|
-
),
|
|
23158
|
-
node.rows && node.rows.length > 0 && (() => {
|
|
23159
|
-
const resolved = node.rows.map((row) => interpolate(row, stateValues));
|
|
23160
|
-
const splits = resolved.map(splitRow);
|
|
23161
|
-
const leftMaxWidth = splits.reduce(
|
|
23162
|
-
(m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)),
|
|
23163
|
-
0
|
|
23164
|
-
);
|
|
23165
|
-
const rightColX = ROW_PAD_X_PX + leftMaxWidth + ROW_COL_GAP_PX;
|
|
23166
|
-
return /* @__PURE__ */ jsxRuntime.jsx("g", { children: splits.map((s, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(0 ${rowBaselineY(node.kind, i)})`, children: [
|
|
23167
|
-
/* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-row", "data-cdl-row-index": i, x: ROW_PAD_X_PX, y: 0, fontSize: 18, fill: "var(--cdl-text-dim, #5a6270)", children: s.left }),
|
|
23168
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
23173
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
23174
|
+
"g",
|
|
23175
|
+
{
|
|
23176
|
+
transform: `translate(${x} ${y})`,
|
|
23177
|
+
"data-cdl-role": "node-body",
|
|
23178
|
+
"data-cdl-look": style.look,
|
|
23179
|
+
children: [
|
|
23180
|
+
shapeEl,
|
|
23181
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${iconX} ${iconY}) scale(1)`, "data-cdl-role": "node-kind-icon", children: [
|
|
23182
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: 24, height: 24, fill: "transparent" }),
|
|
23183
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: style.icon, fill: style.eyebrowColor, opacity: 0.7, transform: "scale(1)" })
|
|
23184
|
+
] }),
|
|
23185
|
+
node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx("text", { x: textX, y: eyebrowY, fontSize: 17, fontWeight: 700, letterSpacing: 1.5, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : style.eyebrowColor, textAnchor, dominantBaseline, children: node.eyebrow }),
|
|
23186
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-label", x: textX, y: titleY, fontSize: 20, fontWeight: 700, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : "var(--cdl-text, #1a1f2a)", textAnchor, dominantBaseline, style: node.kind === "function" || node.kind === "api" ? { fontFamily: "'JetBrains Mono', monospace" } : void 0, children: node.title }),
|
|
23187
|
+
node.subtitle && /* @__PURE__ */ jsxRuntime.jsx("text", { x: textX, y: subtitleY, fontSize: 17, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : "var(--cdl-text-dim, #5a6270)", textAnchor, dominantBaseline, style: { fontFamily: "'JetBrains Mono', monospace" }, children: node.subtitle }),
|
|
23188
|
+
resolvedValue && /* @__PURE__ */ jsxRuntime.jsx(
|
|
23169
23189
|
"text",
|
|
23170
23190
|
{
|
|
23171
|
-
|
|
23172
|
-
|
|
23173
|
-
|
|
23174
|
-
y: 0,
|
|
23175
|
-
fontSize: 21,
|
|
23191
|
+
x: w - 20,
|
|
23192
|
+
y: h - 24,
|
|
23193
|
+
fontSize: 32,
|
|
23176
23194
|
fontWeight: 700,
|
|
23177
|
-
textAnchor: "
|
|
23195
|
+
textAnchor: "end",
|
|
23178
23196
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
23179
23197
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23180
|
-
children:
|
|
23198
|
+
children: resolvedValue
|
|
23181
23199
|
}
|
|
23182
|
-
)
|
|
23183
|
-
|
|
23184
|
-
|
|
23185
|
-
|
|
23200
|
+
),
|
|
23201
|
+
node.rows && node.rows.length > 0 && (() => {
|
|
23202
|
+
const resolved = node.rows.map((row) => interpolate(row, stateValues));
|
|
23203
|
+
const splits = resolved.map(splitRow);
|
|
23204
|
+
const leftMaxWidth = splits.reduce(
|
|
23205
|
+
(m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)),
|
|
23206
|
+
0
|
|
23207
|
+
);
|
|
23208
|
+
const rightColX = ROW_PAD_X_PX + leftMaxWidth + ROW_COL_GAP_PX;
|
|
23209
|
+
return /* @__PURE__ */ jsxRuntime.jsx("g", { children: splits.map((s, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(0 ${rowBaselineY(node.kind, i)})`, children: [
|
|
23210
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-row", "data-cdl-row-index": i, x: ROW_PAD_X_PX, y: 0, fontSize: 18, fill: "var(--cdl-text-dim, #5a6270)", children: s.left }),
|
|
23211
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
23212
|
+
"text",
|
|
23213
|
+
{
|
|
23214
|
+
"data-cdl-role": "node-row",
|
|
23215
|
+
"data-cdl-row-index": i,
|
|
23216
|
+
x: rightColX,
|
|
23217
|
+
y: 0,
|
|
23218
|
+
fontSize: 21,
|
|
23219
|
+
fontWeight: 700,
|
|
23220
|
+
textAnchor: "start",
|
|
23221
|
+
fill: "var(--cdl-text, #1a1f2a)",
|
|
23222
|
+
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23223
|
+
children: s.right
|
|
23224
|
+
}
|
|
23225
|
+
)
|
|
23226
|
+
] }, i)) });
|
|
23227
|
+
})()
|
|
23228
|
+
]
|
|
23229
|
+
}
|
|
23230
|
+
);
|
|
23186
23231
|
}
|
|
23187
23232
|
var MARK_INNER_RATIO = 0.56;
|
|
23188
23233
|
var RING_WIDTH_ACTIVE = 6;
|
|
@@ -30711,6 +30756,8 @@ function infrastructure(preset) {
|
|
|
30711
30756
|
...c.sub ? { sub: c.sub } : {},
|
|
30712
30757
|
tone: c.tone ?? tone,
|
|
30713
30758
|
style: c.style ?? style,
|
|
30759
|
+
...c.role ? { role: c.role } : {},
|
|
30760
|
+
...c.labelPlate === void 0 ? {} : { labelPlate: c.labelPlate },
|
|
30714
30761
|
labelOffsetX: c.labelOffsetX ?? 0,
|
|
30715
30762
|
labelOffsetY: c.labelOffsetY ?? 0
|
|
30716
30763
|
});
|